how to get MS Excel data via ODBC? 
Author Message
 how to get MS Excel data via ODBC?

I need to write a VBScript (ASP) program that will populate certain
sheets/cells in an existing Microsoft Excel spreadsheet.  I have written
a number of ASP applications that access databases via ODBC, so was
hoping to use the same approach using the ODBC driver for Excel.

After I set up my system DSN ("excel_charts" in the example below), the
following will execute without a error, but always produces an empty
result set (rs.eof always tests true) regardless whether there is
actually data in the specified cells or not:

<%
set conn = Server.createobject("adodb.connection")
response.write "created connection<br>"

conn.open "excel_charts"
response.write "opened connection to spreadsheet<br>"

sql = "select * from A1:B1"
set rs=conn.execute(sql)
response.write "got recordset<br>"
%>

The bottom-line question is: where in the heck is the SQL interface for
Excel documented??  The fact that I can't get something as simple as the
above example to produce anything doesn't bode well for the success of
the more complicated EXCEL tasks I want to perform via ODBC.

Any help would be greatly appreciated!!

Thanks
Bruce




Tue, 28 Aug 2001 03:00:00 GMT  
 
 [ 1 post ] 

 Relevant Pages 

1. MS Access data via ODBC in VB4?

2. MS Access data via ODBC in VB4?

3. HELP: Getting table data from EXCEL via Exel OBJECT and then dumping result in Flexgrid

4. MS Visual Basic -> MS Access via ODBC

5. data exchange between MS Excel and MS Project

6. MS ACCESS data to MS EXCEL directly

7. ms project accessbility via odbc

8. ERROR 40002 to MS SQL 6.5 VIA ODBC

9. Attach MS SQL tables via ODBC

10. Need help creating Fox 2.5 table via MS Visual FoxPro ODBC driver

11. Help: Excel VB accessing Oracle via ODBC

12. Reading Excel file via ODBC

 

 
Powered by phpBB® Forum Software