vba 错误:“找不到可安装的 ISAM”

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/512143/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-08 09:36:45  来源:igfitidea点击:

Error: "Could Not Find Installable ISAM"

excelms-accessvbaconnection-string

提问by cLFlaVA

I've written some VBA code in an Excel workbook to retrieve data from an Access database in the same directory on a desktop. It works fine on my machine and several other machines running Windows XP, but when we tested this on a Vista machine, we encountered the following error:

我在 Excel 工作簿中编写了一些 VBA 代码,以从桌面上同一目录中的 Access 数据库中检索数据。它在我的机器和其他几台运行 Windows XP 的机器上运行良好,但是当我们在 Vista 机器上测试时,我们遇到了以下错误:

Could not find installable ISAM

找不到可安装的 ISAM

I've done a bunch of searching online but can't seem to find a concrete answer. The connection string seems to be fine, and, as I mentioned, it works on several machines.

我在网上做了很多搜索,但似乎找不到具体的答案。连接字符串似乎没问题,而且正如我所提到的,它可以在多台机器上运行。

Does anyone have any idea what could be causing this? My connection string is as follows:

有谁知道是什么导致了这种情况?我的连接字符串如下:

Provider=Microsoft.Jet.OLEDB.4.0;Data Source=D:\ptdb\Program Tracking Database.mdb;

Thanks

谢谢

回答by bhupendra singh

Place single quotes around the Extended Properties:

在 周围放置单引号Extended Properties

OleDbConnection oconn = 
    new OleDbConnection(
        @"Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" + path + ";Extended Properties='Excel 8.0;HDR=YES;IMEX=1;';");

Try it, it really works.

试试看,确实有效。

回答by BIBD

Try putting single quotes around the data source:

尝试在数据源周围加上单引号:

Provider=Microsoft.Jet.OLEDB.4.0;Data Source='D:\ptdb\Program Tracking Database.mdb';

The problem tends to be white space which does have meaning to the parser.

问题往往是对解析器有意义的空白。

If you had other attributes (e.g., Extended Properties), their values may also have to be enclosed in single quotes:

如果您有其他属性(例如,扩展属性),它们的值也可能必须用单引号括起来:

Provider=Microsoft.Jet.OLEDB.4.0;Data Source='D:\ptdb\Program Tracking Database.mdb'; Extended Properties='Excel 8.0;HDR=YES;IMEX=1;';

You could equally well use double quotes; however, you'll probably have to escape them, and I find that more of a Pain In The Algorithmthan using singles.

你同样可以使用双引号;然而,你可能不得不逃避它们,我发现算法中的痛苦比使用单打更痛苦

回答by Fionnuala

Have you checked this http://support.microsoft.com/kb/209805? In particular, whether you have Msrd3x40.dll.

你检查过这个http://support.microsoft.com/kb/209805吗?特别是,您是否有 Msrd3x40.dll。

You may also like to check that you have the latest version of Jet: http://support.microsoft.com/kb/239114

您可能还想检查您是否拥有最新版本的 Jet:http: //support.microsoft.com/kb/239114

回答by Rezoan

Just use Jet OLEDB: in your connection string. it solved for me.

只需在您的连接字符串中使用 Jet OLEDB: 即可。它为我解决了。

an example is below:

一个例子如下:

"Provider=Microsoft.Jet.OLEDB.4.0;Persist Security Info=False;Data Source=E:\Database.mdb;Jet OLEDB:Database Password=b10w"

回答by MarkVL

I used this to update a excel 12 xlsx file

我用它来更新一个 excel 12 xlsx 文件

        System.Data.OleDb.OleDbConnection MyConnection;
        System.Data.OleDb.OleDbCommand myCommand = new System.Data.OleDb.OleDbCommand();
        MyConnection = new System.Data.OleDb.OleDbConnection("provider=Microsoft.ACE.OLEDB.12.0;Data Source='D:\Programming\Spreadsheet-Current.xlsx';Extended Properties='Excel 12.0;HDR=YES;';");
        MyConnection.Open();
        myCommand.Connection = MyConnection;
        string sql = "Update [ArticlesV2$] set [ID]='Test' where [ActualPageId]=114";// 
        myCommand.CommandText = sql;
        myCommand.ExecuteNonQuery();
        MyConnection.Close();

回答by Chris Nielsen

I have just encountered a very similar problem.

我刚刚遇到了一个非常相似的问题。

Like you, my connection string appeared correct--and indeed, exactly the same connection string was working in other scenarios.

和你一样,我的连接字符串看起来是正确的——事实上,完全相同的连接字符串在其他场景中也能正常工作。

The problem turned out to be a lack of resources. 19 times out of 20, I would see the "Could not find installable ISAM," but once or twice (without any code changes at all), it would yield "Out of memory" instead.

问题原来是缺乏资源。20 次中有 19 次,我会看到“找不到可安装的 ISAM”,但是有一两次(根本没有任何代码更改),它会产生“内存不足”。

Rebooting the machine "solved" the problem (for now...?). This happened using Jet version 4.0.9505.0 on Windows XP.

重新启动机器“解决”了问题(现在......?)。这是在 Windows XP 上使用 Jet 版本 4.0.9505.0 发生的。

回答by Shahid Manzoor

Use this connection string

使用此连接字符串

string connectionString = @"Provider=Microsoft.ACE.OLEDB.12.0;" +
      "Data Source=" + strFileName + ";" + "Extended Properties=" + "\"" + "Excel 12.0;HDR=YES;" + "\"";

回答by Raghav

Use the connection string below to read from an XLSX file:

使用下面的连接字符串从 XLSX 文件中读取:

string ConnectionString = "Provider=Microsoft.ACE.OLEDB.12.0;Data Source=" + <> + ";Extended Properties=Excel 8.0;";

string ConnectionString = "Provider=Microsoft.ACE.OLEDB.12.0;Data Source=" + <> + ";Extended Properties=Excel 8.0;";

回答by pezi_pink_squirrel

This problem is because the machine can't find the the correct ISAM (indexed sequential driver method) registered that Access needs.

这个问题是因为机器找不到 Access 需要的正确 ISAM(索引顺序驱动程序方法)注册。

It's probably because the machine doesn't have MSACeesss installed? I would make sure you have the latest version of Jet, and if it still doesn't work, find the file Msrd3x40.dll from one of the other machines, copy it somewhere to the Vista machine and call regsvr32 on it (in Admin mode) that should sort it out for you.

可能是因为机器没有安装MSACeesss?我会确保您拥有最新版本的 Jet,如果它仍然无法工作,请从另一台机器中找到文件 Msrd3x40.dll,将其复制到 Vista 机器的某处并在其上调用 regsvr32(在管理员模式下) ) 应该会为您解决。