Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations wOOdy-Soft on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How can I link sqlserver table in access 2000 without ODBC ?

Status
Not open for further replies.

gg70

Programmer
Apr 29, 2000
4
IT
How can I link sqlserver table in access 2000 without ODBC ?
 
Try using ADO to make the connection:<br><br>Dim cnSQLConnect as ADODB.Connection<br>Dim rsMYRecords as ADODB.Recordset<br><br>Set cnSQLConnect = CreateObject(&quot;ADODB.Connection&quot;)<br>cnSQLConnect.provider = &quot;SQLOLEDB&quot;<br>cnSQLConnect.ConnectionString= &quot;User ID=sa;Password=; &quot; & _<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&quot;Data Source=Servername;&quot; & _<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&quot;Initial Catalog=yourtablename&quot;<br>cnSqlConnect.Open<br><br>Set rsMYRecords=CreateObject(&quot;ADODB.Recordset&quot;)<br>rsMYRecords.Cursorlocation=adUseClient<br>rsMYRecords.LockType=adLockBatchOptimistic<br>rsMYRecords.CursorType=adOpenStatic<br><br>rsMYRecords.Open &quot;Select * from tablename&quot;, cnSQLConnect<br><br><br>I am no expert in this but hopefully this will give you something to go on.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top