I wrote a vbscript application that connects to a remote MsSql
database via ODBC. I can connect, query the db and fetch records
without any problem. However I'd like to export the contents of one
table to an Excel 8.0 file on my local filesystem, just like I do it
in MsAccess, using linked tables.
objConnection.execute "insert into OPENROWSET('Microsoft.Jet.OLEDB.
4.0','Excel 8.0;Database=C:\TEST.xls;', 'SELECT * from Sheet1$]')
select * from Computers"
It doesn't work. One error I'm recieving is:
"Ad hoc access to OLE DB provider 'Microsoft.Jet.OLEDB.4.0' has been
denied, You must access this provider through a linded server"
objConnection.execute "SELECT * INTO [Excel 8.0;Database=c:\test.xls].
[Sheet1] FROM Computers"
Gives me this error:
"CREATE TABLE permission denied in database 'xyzDatabase".
I know I only have readonly permissions on the DB, but the Excel sheet
I want to create is on my local filesystem.
Thanks in advance.