using axcel data in an asp apge with ado

Discussion in 'ASP General' started by eric, Nov 8, 2004.

  1. eric

    eric Guest

    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
     
    eric, Nov 8, 2004
    #1
    1. Advertising

  2. eric wrote:
    > 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
    --
    Microsoft MVP -- ASP/ASP.NET
    Please reply to the newsgroup. The email account listed in my From
    header is my spam trap, so I don't check it very often. You will get a
    quicker response by posting to the newsgroup.
     
    Bob Barrows [MVP], Nov 8, 2004
    #2
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. nita
    Replies:
    1
    Views:
    898
    Saravana
    Nov 20, 2004
  2. ronaldlee

    Transfer ADO Code to ADO.NET

    ronaldlee, Dec 17, 2004, in forum: ASP .Net
    Replies:
    1
    Views:
    486
    Kevin Spencer
    Dec 17, 2004
  3. Replies:
    0
    Views:
    1,335
  4. Paul
    Replies:
    5
    Views:
    3,386
    Swanand Mokashi
    Apr 5, 2006
  5. Navin
    Replies:
    1
    Views:
    747
    Ken Schaefer
    Sep 9, 2003
Loading...

Share This Page