Click here to Skip to main content
12,699,489 members (36,244 online)
Rate this:
Please Sign up or sign in to vote.
See more: C# C#4.0
OleDbConnectionStringBuilder sb = new OleDbConnectionStringBuilder();
sb.DataSource = sfd.FileName;//save file dialog filename is the datasource
sb.Provider = "Provider=Microsoft.Jet.OLEDB.4.0;";
sb.Add("Jet OLEDB:Database Password", "123456");
sb.PersistSecurityInfo = false;

bookConn = new OleDbConnection(sb.Provider + "@Data Source=" + sb.DataSource + ";" );
oleDbCmd.Connection = bookConn;

I get an error Saying "could not find installable ISAM " at bookConn.Open

please help me
Posted 8-Jan-13 10:38am
richcb 8-Jan-13 15:43pm
I don't think you need the "@" in front of the Data Source and you might try adding Extended Properties such as: bookConn = new OleDbConnection(sb.Provider + "Data Source=" + sb.DataSource + ";" + "Extended Properties= "Excel 8.0;");

1 solution

Rate this: bad
Please Sign up or sign in to vote.

Solution 1

The reason for this exception is because an error with connection string you prepare.

modify your connection string preparation like this
OleDbConnectionStringBuilder sb =  OleDbConnectionStringBuilder ();
sb.Add("Provider", "Microsoft.Jet.Oledb.4.0");
sb.Add("Jet OLEDB:Database Password", "*******");
sb.Add("Jet OLEDB:System Database",sfd.FileName);
bookConn = new OleDbConnection(sb.ConnectionString);

You can also refer here[^] to know more about connection string preparations. &

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
Top Experts
Last 24hrsThis month

Advertise | Privacy | Mobile
Web02 | 2.8.170118.1 | Last Updated 8 Jan 2013
Copyright © CodeProject, 1999-2017
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100