using axcel data in an asp apge with ado

E

eric

Hi

I am trying to connect to an excel file test.xls located in the same folder
than my asp page

with the following code:
36 Set cnnExcel = Server.CreateObject("ADODB.Connection")
37 cnnExcel.ActiveConnection = "DBQ=" & Server.MapPath("xl_data.xls") &
;DriverId=790;" & "DRIVER={Microsoft Excel Driver (*.xls)};"
cnnExcel.Open

I get the following error:

does anyone knows what to do?
this object doen't manage named arguments: 'ActiveConnection'
/ppl/fra/TMPoi9rs6uuak.Asp, line 37

thanks in advance
 
B

Bob Barrows [MVP]

eric said:
Hi

I am trying to connect to an excel file test.xls located in the same
folder than my asp page

with the following code:
36 Set cnnExcel = Server.CreateObject("ADODB.Connection")
37 cnnExcel.ActiveConnection = "DBQ=" &
Server.MapPath("xl_data.xls") & ;DriverId=790;" & "DRIVER={Microsoft
Excel Driver (*.xls)};"
cnnExcel.Open

I get the following error:

does anyone knows what to do?
this object doen't manage named arguments: 'ActiveConnection'
/ppl/fra/TMPoi9rs6uuak.Asp, line 37
A Connection object does not have an ActiveConnection property. You should
be setting its ConnectionString property.
You can view the ADO documentation at msdn.microsoft.com/library - drill
down into the Data Access node in the TOC.

Additionally, instead of ODBC, you should use the Jet OLEDB provider:
http://www.able-consulting.com/MDAC/ADO/Connection/OLEDB_Providers.htm#OLEDBProviderForMicrosoftJet

Just scroll down to the section about opening an Excel file.

Bob Barrows
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,990
Messages
2,570,211
Members
46,796
Latest member
SteveBreed

Latest Threads

Top