Wednesday, March 7, 2012

Could Not Find Installable ISAM

Pls Can someone tell me why this code is giving me "Could not find installable ISAM"

ProtectedSub Page_Load(ByVal senderAsObject,ByVal eAs System.EventArgs)HandlesMe.Load
Dim strConnAsNew OleDbConnection("Provider=Microsoft.JET.OLEDB.4.0;Data Source=" & Server.MapPath("~/App_Data/WK 48-2007.xls") &";" &"Extended Properties=""EXEL 8.0;HDR=YES""")
strConn.Open()
Dim StrSelectAsString ="SELECT * FROM [Sheet1$]"
Dim CommAsNew OleDbCommand(StrSelect, strConn)
Dim readerAs IDataReader = Comm.ExecuteReader
GRD.DataSource = reader
GRD.DataBind()
reader.Close()
strConn.Close()
EndSub

Hi,

From your description, it seems that you are using OLEDB Jet driver to connect to your EXCEL table, right?

When you try to set custom, provider-specific properties for the Microsoft OLE DB Provider for Jet in the ADO OLE DB connection string, you receive the following error message:

Could not find installable ISAM

CAUSE
The Microsoft OLE DB Provider for Jet includes many custom properties that you can set only after you establish a connection to the database. These provider-specific properties are custom OLE DB session properties. You cannot set these properties in the ADO OLE DB connection string; you must set these properties after the connection is opened.

For these properties in details and get more information on this issue, see
http://support.microsoft.com/kb/318161/en-us

Thanks.

|||

Hi Nai-Dong,

Tnx. Socan i use SqlClient to connect to EXEL table ? How ?

Thanks again

|||

Hi

Hope this is what you are looking for

Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:\MyExcel.xls;Extended Properties="Excel 8.0;HDR=Yes;IMEX=1";

string SQLQuery = "SELECT * FROM [sheet1$]".

// excel worksheet name followed by a "$" and wrapped in "[" "]" brackets.

You can just replace all your OleDB with SQL... In other words, OleDBconnection with SQLConnection and so on.

This query can also be executed using a DataAdapter using the FILL method. That can give you back a dataset which will contain all the rows.

Hope this helps

VJ

|||

Hi,

Tnx. Socan i use SqlClient to connect to EXEL table ? How ?

Since you are using OLEDB driver, you should use OLEDBCommand (using System.Data.OleDb;) to execute your query.

Thanks.

No comments:

Post a Comment