ado, excel

A

asdf

Hello

I've been trying to get data from excel, but haven't been successful. First
I had the excel file on my desktop and I wrote the absolute path for the
source but I got an error about the path so I put the file in the same folder
as the frontpage page I am making and I still can't get the data. The error
is always at the conn.open line.

Which one should I use? The one with the semicolons at the end? Either one?
"Extended Properties=""Excel 8.0;HDR=YES"""
"Extended Properties=""Excel 8.0;HDR=Yes;"";"

Can someone tell me what is wrong by looking at this?
<%
set conn=Server.CreateObject("ADODB.Connection")
conn.Provider="Microsoft.Jet.OLEDB.4.0"
conn.Open "ClinicWard.xls;Extended Properties=""Excel 8.0;HDR=No"""

'set rs=Server.CreateObject("ADODB.recordset")
'rs.Open "Select * from [Sheet1$]", conn

set rs=conn.Execute("Select*From [Sheet1$]")

....


%>

Thank you for your time.
 
A

asdf

Thank you Mr. Berry

I used
conn.Open "Provider=Microsoft.Jet.OLEDB.4.0;" & _
"Data Source=ClinicWard.xls;" & _
"Extended Properties=""Excel 8.0;HDR=No"""
and now I get this error
Error Type:
Microsoft JET Database Engine (0x80004005)
The Microsoft Jet database engine cannot open the file ''. It is already
opened exclusively by another user, or you need permission to view its data.

The file is not open and I have the file set to unrestricted access.


David Berry said:
See
http://www.carlprothman.net/Default.aspx?tabid=87#OLEDBProviderForMicrosoftJetExcel

and http://support.microsoft.com/default.aspx?scid=kb;en-us;278973

--
David Berry
FrontPage Support: http://www.frontpagemvps.com/



asdf said:
Hello

I've been trying to get data from excel, but haven't been successful.
First
I had the excel file on my desktop and I wrote the absolute path for the
source but I got an error about the path so I put the file in the same
folder
as the frontpage page I am making and I still can't get the data. The
error
is always at the conn.open line.

Which one should I use? The one with the semicolons at the end? Either
one?
"Extended Properties=""Excel 8.0;HDR=YES"""
"Extended Properties=""Excel 8.0;HDR=Yes;"";"

Can someone tell me what is wrong by looking at this?
<%
set conn=Server.CreateObject("ADODB.Connection")
conn.Provider="Microsoft.Jet.OLEDB.4.0"
conn.Open "ClinicWard.xls;Extended Properties=""Excel 8.0;HDR=No"""

'set rs=Server.CreateObject("ADODB.recordset")
'rs.Open "Select * from [Sheet1$]", conn

set rs=conn.Execute("Select*From [Sheet1$]")

...


%>

Thank you for your time.
 
D

David Berry

The "other user" in this case could be the server IUSR_<MachineName>
account. Make sure the folder it's in has read/write permissions

--
David Berry
FrontPage Support: http://www.frontpagemvps.com/



asdf said:
Thank you Mr. Berry

I used
conn.Open "Provider=Microsoft.Jet.OLEDB.4.0;" & _
"Data Source=ClinicWard.xls;" & _
"Extended Properties=""Excel 8.0;HDR=No"""
and now I get this error
Error Type:
Microsoft JET Database Engine (0x80004005)
The Microsoft Jet database engine cannot open the file ''. It is already
opened exclusively by another user, or you need permission to view its
data.

The file is not open and I have the file set to unrestricted access.


David Berry said:
See
http://www.carlprothman.net/Default.aspx?tabid=87#OLEDBProviderForMicrosoftJetExcel

and http://support.microsoft.com/default.aspx?scid=kb;en-us;278973

--
David Berry
FrontPage Support: http://www.frontpagemvps.com/



asdf said:
Hello

I've been trying to get data from excel, but haven't been successful.
First
I had the excel file on my desktop and I wrote the absolute path for
the
source but I got an error about the path so I put the file in the same
folder
as the frontpage page I am making and I still can't get the data. The
error
is always at the conn.open line.

Which one should I use? The one with the semicolons at the end?
Either
one?
"Extended Properties=""Excel 8.0;HDR=YES"""
"Extended Properties=""Excel 8.0;HDR=Yes;"";"

Can someone tell me what is wrong by looking at this?
<%
set conn=Server.CreateObject("ADODB.Connection")
conn.Provider="Microsoft.Jet.OLEDB.4.0"
conn.Open "ClinicWard.xls;Extended Properties=""Excel 8.0;HDR=No"""

'set rs=Server.CreateObject("ADODB.recordset")
'rs.Open "Select * from [Sheet1$]", conn

set rs=conn.Execute("Select*From [Sheet1$]")

...


%>

Thank you for your time.
 
T

Thomas A. Rowe

Try importing the Excel file into your current open FP web / site, then create your connection. FYI:
you will do better using an Access database.

--
==============================================
Thomas A. Rowe
Microsoft MVP - FrontPage

http://www.Ecom-Data.com
==============================================


asdf said:
Thank you Mr. Berry

I used
conn.Open "Provider=Microsoft.Jet.OLEDB.4.0;" & _
"Data Source=ClinicWard.xls;" & _
"Extended Properties=""Excel 8.0;HDR=No"""
and now I get this error
Error Type:
Microsoft JET Database Engine (0x80004005)
The Microsoft Jet database engine cannot open the file ''. It is already
opened exclusively by another user, or you need permission to view its data.

The file is not open and I have the file set to unrestricted access.


David Berry said:
See
http://www.carlprothman.net/Default.aspx?tabid=87#OLEDBProviderForMicrosoftJetExcel

and http://support.microsoft.com/default.aspx?scid=kb;en-us;278973

--
David Berry
FrontPage Support: http://www.frontpagemvps.com/



asdf said:
Hello

I've been trying to get data from excel, but haven't been successful.
First
I had the excel file on my desktop and I wrote the absolute path for the
source but I got an error about the path so I put the file in the same
folder
as the frontpage page I am making and I still can't get the data. The
error
is always at the conn.open line.

Which one should I use? The one with the semicolons at the end? Either
one?
"Extended Properties=""Excel 8.0;HDR=YES"""
"Extended Properties=""Excel 8.0;HDR=Yes;"";"

Can someone tell me what is wrong by looking at this?
<%
set conn=Server.CreateObject("ADODB.Connection")
conn.Provider="Microsoft.Jet.OLEDB.4.0"
conn.Open "ClinicWard.xls;Extended Properties=""Excel 8.0;HDR=No"""

'set rs=Server.CreateObject("ADODB.recordset")
'rs.Open "Select * from [Sheet1$]", conn

set rs=conn.Execute("Select*From [Sheet1$]")

...


%>

Thank you for your time.
 

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

Top