error displayed for msexcel sheet

srivalli

Well-known member
Joined
May 4, 2005
Messages
189
Programming Experience
Beginner
provider for msExcel in vb.net

hii,
i am using MSExcel as backend in vb.net.
my query is what is the provider that i need to use for MSExcel.
Assume that i used Microsoft Jet4.0 but what is the extension i must use for an excel file.
is it .xls extension
any one let me know
thk u
 
hii
to retrieve the data in MSExcel ,if i use the Microsoft Jet 4.0 provider ,
then the following error is displayed.

"" Test Connection failed because of an error in initilaizing provider.
Unrecognised database format ' c:\book1.xls'.

here the name of my excel sheet is book1
so which provider i need to use.
let me know.
thks


Kulrom: - Please, Please !!! Stop to post in separated threads for the same Question !!!:eek:
 
Last edited by a moderator:
yes you need to add .xsl extension there.

PHP:
Dim oledbcon As New OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0;" & _
"Data Source=Application.StartupPath & "\fileName.xls;" & _
"Extended Properties=""Excel xx.0;HDR=Yes""")

Note: HDR=Yes tells the provider that first row in the sheet has values that are used as "Field Names", if your sheet doesn't have that then don't say Yes

Cheers ;)
 
Back
Top