Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > ASP General > using axcel data in an asp apge with ado

Reply
Thread Tools

using axcel data in an asp apge with ado

 
 
eric
Guest
Posts: n/a
 
      11-08-2004
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


 
Reply With Quote
 
 
 
 
Bob Barrows [MVP]
Guest
Posts: n/a
 
      11-08-2004
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/...orMicrosoftJet

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.


 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
How to access a UserControl in a Master apge from a content page Paul ASP .Net 5 04-05-2006 04:41 PM
Translating Oracle Package Call from ADO to ADO.Net dmiratsky@yahoo.com ASP .Net 0 02-14-2005 10:39 PM
Transfer ADO Code to ADO.NET ronaldlee ASP .Net 1 12-17-2004 04:08 PM
Accessing an ADO Recordset or Record from ADO.NET nita ASP .Net 1 11-20-2004 07:06 AM
Ado sort error-Ado Sort -Relate, Compute By, or Sort operations cannot be done on column(s) whose key length is unknown or exceeds 10 KB. Navin ASP General 1 09-09-2003 07:16 AM



Advertisments
 



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57