is it possible to retrieve Excel 4.0 worksheet to datagrid ?

G

Guest

hi,
I can open the Excel file(ms Excel 2000 and MS Excel 2003) in my aspx page,It's works fine. my souce code as below
=======================================
Dim myds As New DataSet(
Dim MyExcelConnectStr As String = "Provider=Microsoft.Jet.OLEDb.4.0;data source=d:\" & TextBox1.Text & ".xls" & ";Extended Properties=""Excel 8.0;""
Dim MyOleADapter As New OleDb.OleDbDataAdapter("SELECT * FROM [" & TextBox1.Text & "$]", MyExcelConnectStr
MyOleADapter.Fill(myds, "xlsdata"
=====================================
Now I have a Excel file(Excel 4.0 worksheet file) named "CB1010A-12.XLS",and I want to open it and import the data to my datagrid inside my apsx page.when I run above code,it doesn't work,and have an error message
===Microsoft Jet DataBase Engine not found 'CB1010A-12$' Object======

I tried many times to get the solution with no luck, anyone can tell me what's problem and how to solve it

thanks in advanced
 
M

Martin Dechev

Hi, edward,wei,

I can't tell you what is the error in your code. Probably you will find
useful the links and the examples in the following article:

http://support.microsoft.com/?kbid=316934

Hope this helps
Martin
edward said:
hi,:
I can open the Excel file(ms Excel 2000 and MS Excel 2003) in my aspx
page,It's works fine. my souce code as below:
========================================
Dim myds As New DataSet()
Dim MyExcelConnectStr As String = "Provider=Microsoft.Jet.OLEDb.4.0;data
source=d:\" & TextBox1.Text & ".xls" & ";Extended Properties=""Excel 8.0;"""
Dim MyOleADapter As New OleDb.OleDbDataAdapter("SELECT * FROM [" &
TextBox1.Text & "$]", MyExcelConnectStr)
MyOleADapter.Fill(myds, "xlsdata")
======================================
Now I have a Excel file(Excel 4.0 worksheet file) named
"CB1010A-12.XLS",and I want to open it and import the data to my datagrid
inside my apsx page.when I run above code,it doesn't work,and have an error
message:
===Microsoft Jet DataBase Engine not found 'CB1010A-12$' Object=======

I tried many times to get the solution with no luck, anyone can tell me
what's problem and how to solve it.
 

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