This is Interesting: Free Magazines for Graphics designers and webmasters  


Home > Archive > FrontPage Programming > March 2007 > ado, excel





You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

Author ado, excel
asdf

2007-03-14, 11:15 pm

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.


David Berry

2007-03-14, 11:15 pm

See
http://www.carlprothman.net/Default...crosoftJetExcel

and http://support.microsoft.com/defaul...kb;en-us;278973

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



"asdf" <asdf@discussions.microsoft.com> wrote in message
news:776B367B-6317-4302-8A4D-97A65854780D@microsoft.com...
> 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.
>
>


asdf

2007-03-15, 4:22 am

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" wrote:

> See
> http://www.carlprothman.net/Default...crosoftJetExcel
>
> and http://support.microsoft.com/defaul...kb;en-us;278973
>
> --
> David Berry
> FrontPage Support: http://www.frontpagemvps.com/
>
>
>
> "asdf" <asdf@discussions.microsoft.com> wrote in message
> news:776B367B-6317-4302-8A4D-97A65854780D@microsoft.com...
>

David Berry

2007-03-15, 4:22 am

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" <asdf@discussions.microsoft.com> wrote in message
news:81BD76A3-A0DF-469C-82AA-7D2042CE87FE@microsoft.com...[color=darkred]
> 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" wrote:
>

Thomas A. Rowe

2007-03-15, 7:15 am

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" <asdf@discussions.microsoft.com> wrote in message
news:81BD76A3-A0DF-469C-82AA-7D2042CE87FE@microsoft.com...[color=darkred]
> 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" wrote:
>


Sponsored Links


Copyright 2003 - 2008 forum4designers.com  Software forum  Computer Hardware reviews