Re: using axcel data in an asp apge with ado

Tech Tip: Click here to run a free scan for Windows Errors and optimize PC performance

From: Bob Barrows [MVP] (reb01501_at_NOyahoo.SPAMcom)
Date: 11/08/04


Date: Mon, 8 Nov 2004 08:45:37 -0500

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.


Relevant Pages

  • Re: SBS Fax Rendering
    ... 10.0.6501.0" to Newsgroup. ... Microsoft CSS Online Newsgroup Support ... but it's the first time that i try to send an excel file by fax.. ...
    (microsoft.public.windows.server.sbs)
  • Re: Can I save changes to excel on a floppy?
    ... > Please keep all correspondence within the NewsGroup, ... >> Since technically it is possible to open an Excel File, from wherever, ... and actually save that changed file to a Floppy ... but I don't consider Zips as a floppy. ...
    (microsoft.public.excel.newusers)
  • Re: how to create a file that has tabs (on top or on the left)
    ... Microsoft's Legal Users' Guide) http://addbalance.com/usersguide ... This message is posted to a newsgroup. ... Please post replies ... > starting with A. The ideal is to be similar to an Excel file with many ...
    (microsoft.public.word.docmanagement)
  • Re: TransferSpreadSheet import excel to access problem (undesired reordering)
    ... another newsgroup, so if one of the experts answered your same question in ... I've got a problem importing a worksheet Excel into a temporary table ... This code imported perfectly all the records from the excel file but ...
    (microsoft.public.access.externaldata)
  • Re: transferSpreadSheet problem importing excel to access
    ... another newsgroup, so if one of the experts answered your same question ... I've got a problem importing a worksheet Excel into a temporary table in ... This code imported perfectly all the records from the excel file but since ...
    (microsoft.public.access.modulesdaovba)