228f Sikh Philosophy Network - View Single Post - A Debug Challenge...
View Single Post
  #3 (permalink)  
Old 28-Jul-2006, 08:00 AM
Tony Toews's Avatar Tony Toews
Guest
 
Posts: n/a
   
   
Re: A Debug Challenge...

Sharkbyte wrote:

>DoCmd.RunSQL ("update tblsitevisits set visitdesc = '" & Visit2 & "' where
>servicecall = txtservicecall and sitevisitnumber = txtlastsitevisit;")
>The result is that the Update does not take.
>
>I have stepped through, with warnings...run debug...and substituted values.
Reference:: Sikh Philosophy Network http://www.sikhphilosophy.net/information-technology/9232-a-debug-challenge.html
>No warnings; empty debug window; and any configuration of substituted values
>works.


I prefer, if DAO, to use Currentdb.Execute strSQL,dbfailonerror
command instead of docmd.runsql. For ADO use
CurrentProject.Connection.Execute strCommand, lngRecordsAffected,
Reference:: Sikh Philosophy Network http://www.sikhphilosophy.net/showthread.php?t=9232
adCmdText

If you're going to use docmd.setwarnings make very sure you put the
True statement in any error handling code as well. Otherwise weird
things may happen later on especially while you are working on the
app. For example you will no longer get the "Do you wish to save your
changes" message if you close an object. This may mean that unwanted
changes, deletions or additions will be saved to your MDB.

Also performance can be significantly different between the two
methods. One posting stated currentdb.execute took two seconds while
docmd.runsql took eight seconds. As always YMMV.

Tony
--
Tony Toews, Microsoft Access MVP
Please respond only in the newsgroups so that others can
read the entire thread of messages.
Microsoft Access Links, Hints, Tips & Accounting Systems at
http://www.granite.ab.ca/accsmstr.htm
Reply With Quote
 
Page generated in 0.14912 seconds with 25 queries
0