Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsFormsForms ProgrammingQueriesModules / DAO / VBAReports / PrintingMacrosDatabase DesignSecurityConversionImporting / LinkingSQL Server / ADPMultiuser / NetworkingReplicationSetup / ConfigurationDeveloper ToolkitsActiveX ControlsNew UsersGeneral 1General 2
Access DirectoryToolsTutorialsUser Groups
Related Topics
SQL ServerOther DB ProductsMS OfficeMore Topics ...

MS Access Forum / Queries / November 2005

Tip: Looking for answers? Try searching our database.

Stored Procedure vs Query

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
AnExpertNovice - 22 Nov 2005 21:08 GMT
  cnn.Execute CommandText:="[QueryName]", _
              RecordsAffected:=vbNullString, _
              Options:=adCmdStoredProc Or adExecuteNoRecords

has been used instead of "DoCmd.RunSQL".

The Query was changed but executing the VBA code still uses the previous
query.  I obviously do not understand Stored Procedures because when
anything about them is read it never seems to pertain to anything within an
Access database.

Can someone help with how to update the "StoredProcedure" or a better method
of executing a Query from VBA.  DAO is not referenced since ADO is being
used.
AnExpertNovice - 22 Nov 2005 22:08 GMT
First, I recreated the query with a completely different name.

Excecuting it directly works fine  (98 records are appended).

Executing it from VBA using   DoCmd.OpenQuery "QueryName" works fine   (98
records are appended)

Executing it using appends117 records instead of 98.
  cnn.Execute CommandText:="[QueryName]", _
              RecordsAffected:=vbNullString, _
              Options:=adCmdStoredProc Or adExecuteNoRecords

Quite frustrating.
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.