This is a very basic example of how to connect to a SQL Server. The Recordset object and Connection object have many more properties than these.
For more information about the other properties, please go to:
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnado/html/msdn_workshp2.asp?frame=true
Begin with making sure your Project has a reference to 'Microsoft ActiveX Data Objects 2.x Library' where x is (preferably) the highest number.
[tt]
' **** Create Connection and Recordset Objects ****
Dim cnConn As ADODB.Connection
Dim rs As ADODB.Recordset
' **** Instantiate the new objects ****
Set cnConn = New ADODB.Connection
Set rs = New ADODB.Recordset
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.