954,496 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Have something to say? Contribute New Article Reply to this Article

Export Data From Excel to ASP and SQL Server

I copied book1.xls into IISServer c:/inetpup/wwwroot

objConn.Open "Driver={Microsoft Excel Driver (*.xls)};DriverId=790;DBQ=" & Server.mappath("/book1.xls") &";ReadOnly= true ; UID=admin;"

Dim strSQL
excelfilename = "Book1.xls"

strSQL = "select * from " & excelfilename

Dim objRS
Set objRS = Server.CreateObject ("ADODB.RecordSet")
objRS.Open strSQL, objConn,3,3

When I execute the page

Error Type:
Microsoft OLE DB Provider for ODBC Drivers (0x80040E21)
ODBC driver does not support the requested properties.

Please help me

Regards
Chandrakumar
[email]chandrakumar@dzinegarage.com[/email]

Chandrakumar
Newbie Poster
2 posts since Sep 2005
Reputation Points: 10
Solved Threads: 0
 

That's Visual Basic, not C or C++. Please direct your question to a more appropriate forum.

Narue
Bad Cop
Administrator
15,460 posts since Sep 2004
Reputation Points: 6,464
Solved Threads: 1,401
 

I Upload Book1.xls in to IISServer machine c:\Inetpub\wwwroot

When I am Using this code in ASP

Dim objConn
Set objConn = Server.CreateObject ("ADODB.Connection")
'response.write Server.mappath("/")
'response.end
objConn.Open "Driver={Microsoft Excel Driver (*.xls)};DriverId=790;DBQ=" & Server.mappath("/book1.xls") &";ReadOnly= true ; UID=admin;"

Dim strSQL
excelfilename = "Book1.xls"

strSQL = "select * from " & excelfilename

Dim objRS
Set objRS = Server.CreateObject ("ADODB.RecordSet")
objRS.Open strSQL, objConn,2,3


Microsoft OLE DB Provider for ODBC Drivers (0x80004005)
[Microsoft][ODBC Excel Driver] The Microsoft Jet database engine cannot open the file 'Book1'. It is already opened exclusively by another user, or you need permission to view its data.

Please help me.

Chandrakumar
Newbie Poster
2 posts since Sep 2005
Reputation Points: 10
Solved Threads: 0
 

What part of "You're in the wrong forum" is difficult?

Narue
Bad Cop
Administrator
15,460 posts since Sep 2004
Reputation Points: 6,464
Solved Threads: 1,401
 

This article has been dead for over three months

Post: Markdown Syntax: Formatting Help
You