Holy cow! I've had a heck of a time attempting to get a post out to all
those who were kind enough to respond to my post. Thank-you to everyone who
has attempted to help me out.

To CN Davis:

I agree that it looks like I have some sort of registry problem. Here's
something interesting: When I first saw the error I inspected the registry
entries for the Access OBDC driver on both the NT server and the Window 95
client machine that I use for development. The NT machine had no key for
'DriverID' but the Windows 95 machine did. Then I installed Access 97 on my
client machine and the 'DriverID' key disappeared.

I have tried your suggestion re 8 chars with no success.

I will dump Access as my database ASAP but I'm stuck with it for a while
longer.


To Deepak Prabhu:

I have tried running the code without creating a new driver instance and I
have tried several variations of the getConnection method without success.

I can run the code from within a Java application, independent of JRun, on
the NT server and it executes successfully. When I move the code into a
servlet I get the error. I am running Jrun 2.3.To Marko Ferisak:
Interesting suggestion. I will attempt to implement it; however, I'm not the
only one using the server so it may be a while before I can try this.


To ? (I'm sorry - I lost several responses to my post so I can't respond to
specific names):

Yes, I created a System DSN datasource on the NT server.



> >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>

Hi,
>
>I have encountered a problem when attempting to connect to a MS Access
>database hosted on an NT Server running JRun
>using a servlet. I have created an ODBC datasource for the
>Access database on the NT server.
>
>I first used a simple Java program to connect to the database
>and output some records from a table. It executed successfully.
>
>I then used the identical code in a simple servlet. The code
>snippet for connecting to the database is as follows:
>
>       // The name of the JDBC driver to use
>       String driverName = "sun.jdbc.odbc.JdbcOdbcDriver";>

>       // The JDBC connection URL
>       String connectionURL = "jdbc:odbc:MyAccessDataSource";

>       try {
>
>          // Create an instance of the JDBC driver so that it has
>          // a chance to register itself
>          Class.forName(driverName).newInstance();
>
>          // Create a new database connection.
>          con = DriverManager.getConnection(connectionURL);
>
>          ...
>
>At this point in the execution, I get the following error message:>
>Exception! java.sql.SQLException: [Microsoft][ODBC Microsoft Access
>Driver]General error Unable to open registry key 'DriverId'. at
>sun.jdbc.odbc.JdbcOdbc.createSQLException(Compiled Code) at
>sun.jdbc.odbc.JdbcOdbc.standardError(JdbcOdbc.java:4246) at
>sun.jdbc.odbc.JdbcOdbc.SQLDriverConnect(JdbcOdbc.java:1136) at
>sun.jdbc.odbc.JdbcOdbcConnection.initialize(JdbcOdbcConnection.java:148) at
>sun.jdbc.odbc.JdbcOdbcDriver.connect(JdbcOdbcDriver.java:167) at
>java.sql.DriverManager.getConnection(Compiled Code) at
>java.sql.DriverManager.getConnection(DriverManager.java:159) at
>EmployeeList.query(EmployeeList.java:148) at
>EmployeeList.doGet(EmployeeList.java:66) at
>javax.servlet.http.HttpServlet.service(HttpServlet.java:516) at
>javax.servlet.http.HttpServlet.service(Compiled Code) at
>com.livesoftware.jrun.JRun.runServlet(Compiled Code) at
>com.livesoftware.jrun.JRunGeneric.handleConnection(Compiled Code) at
>com.livesoftware.jrun.JRunGeneric.handleProxyConnection(Compiled Code) at
com.livesoftware.jrun.service.proxy.JRunProxyServiceHandler.handleRequest(Co
mpiledCode)
________________________________________________________________________
Get Your Private, Free E-mail from MSN Hotmail at http://www.hotmail.com

___________________________________________________________________________
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff SERVLET-INTEREST".

Archives: http://archives.java.sun.com/archives/servlet-interest.html
Resources: http://java.sun.com/products/servlet/external-resources.html
LISTSERV Help: http://www.lsoft.com/manuals/user/user.html

Reply via email to