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("ADODB.Connection"<br>cnSQLConnect.provider = "SQLOLEDB"<br>cnSQLConnect.ConnectionString= "User ID=sa;Password=; " & _<br> "Data Source=Servername;" & _<br> "Initial Catalog=yourtablename"<br>cnSqlConnect.Open<br><br>Set rsMYRecords=CreateObject("ADODB.Recordset"<br>rsMYRecords.Cursorlocation=adUseClient<br>rsMYRecords.LockType=adLockBatchOptimistic<br>rsMYRecords.CursorType=adOpenStatic<br><br>rsMYRecords.Open "Select * from tablename", cnSQLConnect<br><br><br>I am no expert in this but hopefully this will give you something to go on.
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.