![]() |
![]() | ![]() | ![]() | ![]() | ![]() | ![]() | ![]() |
| Welcome to Windows Vista Forums. Our forum is dedicated to helping you find solutions with any problems, errors or issues you are experiencing with Windows Vista. The Vista forum also covers news and updates and has an extensive Windows Vista tutorial section that covers a wide range of tips and tricks. |
| |||||||
![]() |
| |
| | #1 (permalink) |
| | Exporting MsSQL table to Excel using vbScript? Hi, 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. Syntax #1: 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" Syntax #2: 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. Any suggestion? Thanks in advance. |
My System Specs![]() |
![]() |
| Thread Tools | |
| |
Similar Threads | ||||
| Thread | Forum | |||
| vbscript to alter table in msaccess | VB Script | |||
| Exporting an Excel file | Vista General | |||
| ways to connect to MSSQL 2000 sever via vbscript | VB Script | |||
| Exporting to excel | PowerShell | |||
| dynamic table excel 2007? | Vista General | |||