Home > Backend Development > C#.Net Tutorial > Detailed introduction: When using c# to access the Access database, it prompts that the installable ISAM cannot be found (picture)

Detailed introduction: When using c# to access the Access database, it prompts that the installable ISAM cannot be found (picture)

黄舟
Release: 2017-03-11 13:22:48
Original
1959 people have browsed it


When using c# to access the Access database, it prompts Cannot find installable ISAM, as shown below:
Detailed introduction: When using c# to access the Access database, it prompts that the installable ISAM cannot be found (picture)

Code As follows:

connectionString = "Provider=Microsoft.Jet.OLEDB.4.0; Data Source=db.mdb;Pwd=abcd;";
            conn = new OleDbConnection(connectionString);

            conn.Open();

            DataTable dt = conn.GetSchema("Tables");

            if (dt != null && dt.Rows.Count != 0)
            {
                for (int i = 0; i < dt.Rows.Count; i++ )
                {
                    listBox1.Items.Add(dt.Rows[i]["TABLE_NAME"].ToString());
                }
            }

            conn.Close();
Copy after login
Copy after login

After many modifications and tests, it was found that as long as unrecognizable keywords and configuration project names appear in the connection string, a prompt cannot be installed with ISAM will be prompted. mistake.
The "Pwd" in the above connection string is available in the SQL Server connection string, but it is not recognized in Access.

For example, the following statement will also prompt Cannot find the installable ISAM error:

connectionString = "Provider=Microsoft.ACE.OLEDB.12.0; Data Source=db.mdb;abcd=123";
Copy after login
Copy after login

Correct connection string writing:

connectionString = "Provider=Microsoft.Jet.OLEDB.4.0; Data Source=db.mdb;jet oledb:database password=123;";
//或者:            
connectionString = "Provider=Microsoft.ACE.OLEDB.12.0; Data Source=db.mdb;jet oledb:database password=123;";
Copy after login
Copy after login

When using c# to access the Access database, it prompts Cannot find installable ISAM, as shown below:
Detailed introduction: When using c# to access the Access database, it prompts that the installable ISAM cannot be found (picture)

The code is as follows :

connectionString = "Provider=Microsoft.Jet.OLEDB.4.0; Data Source=db.mdb;Pwd=abcd;";
            conn = new OleDbConnection(connectionString);

            conn.Open();

            DataTable dt = conn.GetSchema("Tables");

            if (dt != null && dt.Rows.Count != 0)
            {
                for (int i = 0; i < dt.Rows.Count; i++ )
                {
                    listBox1.Items.Add(dt.Rows[i]["TABLE_NAME"].ToString());
                }
            }

            conn.Close();
Copy after login
Copy after login

After many modifications and tests, it was found that as long as unrecognizable keywords and configuration project names appear in the connection string, an error cannot be found for installing ISAM will be prompted. .
The "Pwd" in the above connection string is available in the SQL Server connection string, but it is not recognized in Access.

For example, the following statement will also prompt Cannot find the installable ISAM error:

connectionString = "Provider=Microsoft.ACE.OLEDB.12.0; Data Source=db.mdb;abcd=123";
Copy after login
Copy after login

Correct connection string writing:

connectionString = "Provider=Microsoft.Jet.OLEDB.4.0; Data Source=db.mdb;jet oledb:database password=123;";
//或者:            
connectionString = "Provider=Microsoft.ACE.OLEDB.12.0; Data Source=db.mdb;jet oledb:database password=123;";
Copy after login
Copy after login

The above is the detailed content of Detailed introduction: When using c# to access the Access database, it prompts that the installable ISAM cannot be found (picture). For more information, please follow other related articles on the PHP Chinese website!

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template