UtterAccess.com
X   Site Message
(Message will auto close in 2 seconds)

Welcome to UtterAccess! Please ( Login   or   Register )

Custom Search
 
   Reply to this topicStart new topic
> Access Append Warning On Docmd.runsql, Access 2016    
 
   
cpsmith58
post Mar 20 2017, 10:32 AM
Post#1



Posts: 110
Joined: 22-February 17



I have searched a lot. Everyone says if you turn off the errors and run it, then turn them back on, you don't get that "You're about to insert a record..." warning. But turning off the error also prevents me from seeing/trapping an actual error.

Common wisdom seems be to use CurrentDb.Execute(strSQL, dbFailOnError) where strSQL is a fully valid SQL statement.

But it looks like CurrentDB is a DAO object and in general, it seems like I am just using base Access (Jet?) functionality.

A) Do I need to set a reference and Dim an object and run Currentdb.execute?

B) How many different ways do I need to touch my db? This is just a simple split db on a network share, not complex at all. I am looking for "If you're doing this, use Jet, otherwise use DAO else use ADO". Not finding that high level stuff.

Thanks

Go to the top of the page
 
theDBguy
post Mar 20 2017, 10:41 AM
Post#2


Access Wiki and Forums Moderator
Posts: 69,940
Joined: 19-June 07
From: SunnySandyEggo


Hi,

You have selected Access 2016 as your version. If it's correct, then you don't have to worry about any of the above because DAO is now part of the ACE (it replaced JET) engine .

So, no, you don't need to set a reference to a DAO library anymore (as long as you have a reference set to Microsoft Office xx Access Database engine Object Library) to use DAO objects and methods.

PS. Also, check out this previous discussion.

Hope it helps...

--------------------
Go to the top of the page
 
cpsmith58
post Mar 20 2017, 11:21 AM
Post#3



Posts: 110
Joined: 22-February 17



Thanks, DBGuy!

That link to the discussion was helpful. Basically, DAO is intrinsic. Still good to fully define it thought.

I assumed I had a reference error, it was syntax.

I was using:
CurrentDb.Execute(strSQL, dbFailOnError)

which the Intelliesense said was proper, see image.

It works now as:
CurrentDb.Execute strSQL, dbFailOnError (no parentheses).







Attached File(s)
Attached File  25.png ( 2.97K )Number of downloads: 0
 
Go to the top of the page
 
theDBguy
post Mar 20 2017, 11:23 AM
Post#4


Access Wiki and Forums Moderator
Posts: 69,940
Joined: 19-June 07
From: SunnySandyEggo


Hi,

Glad to hear you got it sorted out. Good luck with your project.

--------------------
Go to the top of the page
 


Custom Search
RSSSearch   Top   Lo-Fi    23rd June 2017 - 05:16 AM