Using this code found on the web, I'm able to connect to our DB:
Const adOpenStatic = 3
Const adLockOptimistic = 3
Const adUseClient = 3
Set objConnection = CreateObject("ADODB.Connection")
Set objRecordset = CreateObject("ADODB.Recordset")
objConnection.Open "DSN=SomeDBInstance;"
objRecordset.CursorLocation = adUseClient
objRecordset.Open "SELECT * FROM Computers" , objConnection, _
adOpenStatic, adLockOptimistic
I'm trying to send the resultset to my local filesystem, in Excel 8.0
format. I'm using an ODBC bridge to access data on a remote MsSQL
box.
I've been trying:
SELECT <whatever> INTO['Excel 8.0;Database=C:\xyx.xls'] <from>
objRecordset.Open "INSERT INTO OPENROWSET ('Microsoft.Jet.OLEDB.
4.0,Excel 8.0;Database=c:\contact.xls;'", "SELECT * FROM ...
But nothing works. It's strange because the first example above works
well in MSAccess.
Thanks for your help