Instead to set the ado reference in a vba project is possible to set ado connection via ...CreteObject ecc... similar a outllok binding mode?
Note:
In effect i dont know wich version of ado have all user tath use my application:-)
open ADO via object create....
-
- Administrator
- Posts: 78629
- Joined: 16 Jan 2010, 00:14
- Status: Microsoft MVP
- Location: Wageningen, The Netherlands
Re: open ADO via object create....
You can use code like this:
In the last line, the numbers 1, 3, 1 correspond to the ADODB constants adOpenKeyset, adLockOptimistic and adCmdText, respectively. You have to look up the values of these constants in the Object Browser in Access, or in another application where you have set a reference to ADO.
Code: Select all
Dim cnn As Object
Dim rst As Object
Dim strConnection As String
Dim strSQL As String
strConnection = "..."
strSQL = "SELECT ..."
Set cnn = CreateObject("ADODB.Connection")
cnn.Open strConnection
Set rst = CreateObject("ADODB.Recordset")
rst.Open strSQL, cnn, 1, 3, 1
Best wishes,
Hans
Hans