Since ADO requires opening and closing a connection object, I would assume RunSQL, has less overhead.
I use this often,
CurrentProject.Connection.Execute _
"INSERT INTO tblNumber(txtNumber)VAL..."
Thanks for your input! JerryKlmns, I noticed you entered "129" for the RecordsAffected argument. Is this the exact number of records to process or is it a code meaning we chose an option of adExecuteNoRecords? Can I optionally enter the adExecuteNoRecords for this argument?
I've never used these arguments before. I looked within the help and found no reference to the 129 number. Please give me a little more detail. This advise is REALLY helpful to me.
129 is as JerryKlmns states, the constants adCmdText and adExecuteNoRecords added up. This is what is passed as the options arguement when using the .Execute method of the connection. Help file states something like:
"Options, Optional long value that indicates how the provider should evaluate the CommandText arguement. Can be a bitmask of one or more CommandTypeEnum or ExecuteOptionEnum values."
Here it's a combination of adCmdText meaning dynamic sql string, and adExecuteNoRecords which means that no recordset is returned by the operation.
Of other CommandTypeEnums that are often relevant, you can use adCmdTable for table (when specifying a table as "sqlstring", it will for some reason return the equivalent of "select * from thattable"), adCmdTableDirect - which makes it possible to use the .Seek method, adCmdStoredProc - for stored queries (Access) and stored procedures ... but I suppose there should be a term or two here to play with in the object browser (F2) or the help files;-)
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.