Here is a function I had to add a table to sql server and it shows a connection string maybe you can get what you need from this example.
Function AddSQLServerTable()
'-- set reference to ADOX library
'- Microsoft ADO Ext. 2.6 for DDL and Security
'-- Microsoft ActiveX data objects 2.6 library also needed for ADO
Dim connString As String
Dim cn As New ADODB.Connection
connString = "provider=SQLOLEDB.1;" & _
"User ID=sa;Initial Catalog=northwind;" & _
"Data Source=bigtuna;" & _
"Persist Security Info=False"
cn.ConnectionString = connString
cn.Open connString
'-- now connected to the sql server database through cn
Dim cg As New ADOX.Catalog
Dim tb As New ADOX.Table
Set cg.ActiveConnection = cn
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.