Import Excel 2007 into SQL 2000 using Classic ASP and ADO

Posted by jeff on Stack Overflow See other posts from Stack Overflow or by jeff
Published on 2010-04-28T13:22:31Z Indexed on 2010/04/28 13:23 UTC
Read the original article Hit count: 541

Filed under:
|
|
|

I have the following code from a legacy app which currently reads from an excel 2003 spreadsheet on a server, but I need this to run from my machine which uses excel 2007. When I debug on my machine ADO does not seem to be reading the spreadsheet. I have checked all file paths etc. and location of spreadsheet that is all fine. I've heard that you cannot use the jet db engine for excel 2007 anymore? Can someone confirm this? What do I need to do to get this to work? Please help!

set obj_conn = Server.CreateObject("ADODB.Connection")
obj_conn.Open   "Provider=Microsoft.Jet.OLEDB.4.0;" & _
            "Data Source=" & Application("str_folder") & "CNS43.xls;" & _
            "Extended Properties=""Excel 8.0;"""
set obj_rs_cns43 = Server.CreateObject("ADODB.RecordSet")
obj_rs_cns43.ActiveConnection = obj_conn
obj_rs_cns43.CursorType = 3
obj_rs_cns43.LockType = 2
obj_rs_cns43.Source = "SELECT * FROM [CNS43$]"
obj_rs_cns43.Open

© Stack Overflow or respective owner

Related posts about excel-2007

Related posts about sql-server