“一般错误无法打开注册表项临时(易失性)......”来自Access ODBC [英] "General error Unable to open registry key Temporary (volatile) ..." from Access ODBC

查看:572
本文介绍了“一般错误无法打开注册表项临时(易失性)......”来自Access ODBC的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我尝试了以下内容:

private String password = "";
private String dbName = "dataHC.accdb";
private String bd = dbName + ";PWD=" + password;
String  url   = "jdbc:odbc:Driver={Microsoft Access Driver (*.mdb, *.accdb)};DBQ="+bd+";";

private Connection conn = null;

//Connect
public void connect() {
    try{
        Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
        conn = DriverManager.getConnection(url);
        if (conn != null)
            System.out.println("Conexión a base de datos "+dbName+". listo");
    }catch(SQLException e){
        System.out.println(e);
    }catch(ClassNotFoundException e){
        System.out.println(e);
    }
}

字体: http://www.jc-mouse.net/base-de- datos / consultas-con-parametros-en-access-y-java

我收到此错误:


[Microsoft] [ODBC Microsoft Access驱动程序]常规错误无法打开注册表项临时(易失性)Ace DSN进程0x7f8线程0x1174 DBC

[Microsoft][ODBC Microsoft Access Driver]General error Unable to open registry key Temporary (volatile) Ace DSN for process 0x7f8 Thread 0x1174 DBC

具体

java.sql.SQLException: [Microsoft][ODBC Microsoft Access Driver]General error Unable to open registry key Temporary (volatile) Ace DSN for process 0x7f8 Thread 0x1174 DBC 0x8dc8d78                                                              Jet'.
Exception in thread "main" java.lang.NullPointerException
    at depuracionDB.consultap(depuracionDB.java:67)
    at depuracionDB.main(depuracionDB.java:103)

我使用的是eclipse IDE Luna和Java版本1.7.0_45(64位)

I am using eclipse IDE Luna and Java version "1.7.0_45" (64 bits)

推荐答案

原因



Causes


一般错误无法打开注册表项临时(volatile) )进程的Ace DSN ...

General error Unable to open registry key Temporary (volatile) Ace DSN for process ...

这是Access数据库引擎(又名ACE)产生的顶级错误消息)ODBC驱动程序当前进程无法打开Access数据库文件时出于以下原因之一:

This is the top-level error message produced by the Access Database Engine (a.k.a. "ACE") ODBC driver when the current process is unable to open the Access database file for one of the following reasons:


  1. 其他一些进程已经专门打开了数据库。

  1. Some other process has opened the database "exclusively".

其他一些进程最初在Access中打开数据库文件为共享,
有一些待定的结构修改这需要独占访问该文件。此类待处理修改的示例是对尚未保存的模块代码的编辑,或者在设计视图中打开表单或报表。

Some other process originally opened the database file in Access as "shared" and has some pending structural modification that requires "exclusive" access to the file. Examples of such pending modifications are edits to Module code that have not yet been saved, or having a Form or Report open in Design View.

当前进程正在运行,没有足够的文件系统权限来打开数据库文件或它所在的文件夹。

The account under which the current process is running does not have sufficient filesystem permissions to open the database file or the folder in which it resides.

当前进程所在的帐户运行没有足够的注册表权限来访问 HKLM \ SOFTWARE \\ _ODBC 键下的值。

The account under which the current process is running does not have sufficient registry permissions to access the values under the HKLM\SOFTWARE\ODBC key.

数据库文件根本不存在。

The database file simply does not exist.

当仅报告顶级错误消息时,早期的JetODBC驱动程序产生了一些更直观的错误消息。当另一个进程对文件执行Open Exclusive时,错误消息是

When only the top-level error message is reported, the earlier "Jet" ODBC driver produced somewhat more intuitive error messages. When the other process had done an "Open Exclusive" on the file the error message was


无法使用'(未知)';文件已在使用中。

Could not use '(unknown)'; file already in use.

当文件有待处理的设计更改时,错误消息显示

and when the file had pending design changes the error message said


数据库已被未知用户置于某状态,阻止其被打开或锁定。

The database has been placed in a state by an unknown user that prevents it from being opened or locked.

但是,当我们只看到ACE ODBC驱动程序产生的顶级消息时,我们看到的是

However, when we only see the top-level message produced by the ACE ODBC driver all we see is


General错误无法打开注册表项临时(易失性)Ace DSN进程...

General error Unable to open registry key Temporary (volatile) Ace DSN for process ...

这是因为两个驱动程序都返回多条错误消息,但他们以不同的顺序归还他们。 Jet消息是...

That is because both drivers return multiple error messages, but they return them in a different order. The Jet messages are ...


错误[HY000] [Microsoft] [ODBC Microsoft Access驱动程序]数据库已处于某状态由未知用户阻止它被打开或锁定。

ERROR [HY000] [Microsoft][ODBC Microsoft Access Driver] The database has been placed in a state by an unknown user that prevents it from being opened or locked.

错误[01000] [Microsoft] [ODBC Microsoft Access驱动程序]常规警告无法打开注册表项'临时(volatile)Jet DSN for process 0xed4 Thread 0x1204 DBC 0xab004 Jet'。

ERROR [01000] [Microsoft][ODBC Microsoft Access Driver]General Warning Unable to open registry key 'Temporary (volatile) Jet DSN for process 0xed4 Thread 0x1204 DBC 0xab004 Jet'.

ERROR [IM006] [Microsoft] [ODBC驱动程序管理器]驱动程序的SQLSetConnectAttr失败

ERROR [IM006] [Microsoft][ODBC Driver Manager] Driver's SQLSetConnectAttr failed

错误[01000] [Microsoft] [ODBC Microsoft Access驱动程序]常规警告无法打开注册表项'临时(易失性)Jet DSN用于进程0xed4线程0x1204 DBC 0xab004 Jet'。

ERROR [01000] [Microsoft][ODBC Microsoft Access Driver]General Warning Unable to open registry key 'Temporary (volatile) Jet DSN for process 0xed4 Thread 0x1204 DBC 0xab004 Jet'.

错误[HY000] [Microsoft] [ODBC Microsoft Access驱动程序]数据库已被未知用户置于某状态,阻止其被打开或锁定。

ERROR [HY000] [Microsoft][ODBC Microsoft Access Driver] The database has been placed in a state by an unknown user that prevents it from being opened or locked.

...而ACE消息是:

... while the ACE messages are:


错误[HY000] [Microsoft] [ODBC Microsoft Access驱动程序]一般错误无法打开注册表项临时(易失性)Ace DSN用于进程0xf6c线程0x1568 DBC 0x6347fec Jet'。

ERROR [HY000] [Microsoft][ODBC Microsoft Access Driver]General error Unable to open registry key Temporary (volatile) Ace DSN for process 0xf6c Thread 0x1568 DBC 0x6347fec Jet'.

错误[IM006] [微软] [ODBC驱动程序管理器]驱动程序的SQLSetConnectAttr失败

ERROR [IM006] [Microsoft][ODBC Driver Manager] Driver's SQLSetConnectAttr failed

错误[HY000] [ Microsoft] [ODBC Microsoft Access驱动程序]常规错误无法打开注册表项临时(易失性)进程0xf6c的Ace DSN线程0x1568 DBC 0x6347fec Jet'。

ERROR [HY000] [Microsoft][ODBC Microsoft Access Driver]General error Unable to open registry key Temporary (volatile) Ace DSN for process 0xf6c Thread 0x1568 DBC 0x6347fec Jet'.

错误[HY000] [Microsoft] [ODBC Microsoft Access驱动程序]数据库已被未知用户置于某状态,阻止其被打开或锁定。

ERROR [HY000] [Microsoft][ODBC Microsoft Access Driver] The database has been placed in a state by an unknown user that prevents it from being opened or locked.

错误[HY000] [ Microsoft] [ODBC Microsoft Access驱动程序]常规错误无法打开注册表项临时(易失性)Ace DSN进程0xf6c线程0x1568 DBC 0x6347fec Jet'。

ERROR [HY000] [Microsoft][ODBC Microsoft Access Driver]General error Unable to open registry key Temporary (volatile) Ace DSN for process 0xf6c Thread 0x1568 DBC 0x6347fec Jet'.

错误[HY000] [Microsoft] [ODBC Microsoft Access驱动程序]常规错误无法打开注册表项临时(易失性)Ace DSN进程0xf6c线程0x1568 DBC 0x6347fec Jet'。

ERROR [HY000] [Microsoft][ODBC Microsoft Access Driver]General error Unable to open registry key Temporary (volatile) Ace DSN for process 0xf6c Thread 0x1568 DBC 0x6347fec Jet'.

错误[HY000] [Microsoft] [ODBC Microsoft Access驱动程序]数据库已被未知用户置于某个状态,阻止它被打开或锁定。

ERROR [HY000] [Microsoft][ODBC Microsoft Access Driver] The database has been placed in a state by an unknown user that prevents it from being opened or locked.



解决方案



情景1和2(另一个进程对文件具有独占锁定):



确保数据库文件未被任何其他进程打开–通常这意味着只关闭Access应用程序本身–然后从外部应用程序重新尝试ODBC操作。重新启动计算机是确保终止任何其他此类进程并放弃对数据库文件的声明的一种方法。

Solutions

Scenarios 1 and 2 (another process has an "exclusive" lock on the file):

Ensure that the database file is not opened by any other process – often that means just closing the Access application itself – and then re-try the ODBC operation from your external application. Rebooting your machine is one way to ensure that any other such processes have been terminated and have relinquished their claim to the database file.

调整权限或将文件移动到用户可以打开文件的位置。将数据库文件放在驱动器的根文件夹中是导致此类问题的常见原因。

Either adjust the permissions or move the file to a location where the user can open the file. Placing the database file in the root folder of a drive is a common cause of this type of problem.

调整注册表权限以允许帐户访问 HKLM \ SOFTWARE \ODBC 键。在这种情况下,最常见的原因是IIS进程在没有正常用户权限的帐户下运行。在这种情况下,请记住你不应该使用带有IIS的Access数据库

Adjust the registry permissions to allow the account to access the HKLM\SOFTWARE\ODBC key. The most common cause in this case is that an IIS process is running under an account that does not have normal "user" privileges. In that case remember that you should not be using Access databases with IIS anyway.

修复连接字符串,使其包含现有文件的有效路径。

Fix the connection string so that it contains a valid path to an existing file.

这篇关于“一般错误无法打开注册表项临时(易失性)......”来自Access ODBC的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆