ADO connection and recordset syntax

Lol999

Registered User.
Local time
Yesterday, 18:49
Joined
May 28, 2017
Messages
184
Hi, hoping someone could help me with this one as I'm having a brain melt at the moment.
Just what is the correct syntax for creating an ADO connection and a recordset therein?
I know it involves declaring variables to hold strings and using the SET command but I would just like to know the proper, correct way to do it once and for all.
I'm using Access 2013 if that helps.

many thanks, Lol
 
Lol, there is not one proper way to do it. You can declare the objects using the new keyword. You can create your own connection using a connection string, you can use the CurrentProject.AccessConnection. You can pass an SQL expression to the Recordset.Open method, or you can pass the name of a query or the name of a table. You can also not declare a recordset variable at all, but instead open the recordset in a With...End With block, and I could go on, and on.
If you are troubleshooting opening a recordset in the context of some code you are currently writing, why don't you post the code, and explain how it fails. Then we can assist you moving forward.
hth
Mark
 
Thanks Mark, a bit late now I'll post something tomorrow night if I'm still struggling.
 
Hi Mark it's possible. I'm going to try it tonight and let you know if I continue struggling.

Thanks, Lol
 
Hi Mark, I managed to master the syntax thank you.

Cheers, Lol
 

Users who are viewing this thread

Back
Top Bottom