Hi Mehmet,

I too had the same problem as you describe when I started working with
servlets and Access. I work with MS Access databases v97 and v2000 and am
able to connect OK but only after changing my Driver name (see below). The
Web server I use for development is a freebie (vqServer) found at
www.vqsoft.com and has a built-in servlet engine so does exactly what I
want. When I first used this server, however, I had the same problem you
have now (or it appears to be the same problem). I searched the Help files
of the web server I refer to and found the following advice which I followed
and the problem was cured immediately. Try the same and see if it cures your
problem. The new driver it refers to should already be in your system
somewhere, i.e. I didn't have to install it from anywhere.

Best of luck (let me know if it works).

Billy Graham.

===============HELP FILE INFO FROM vqServer ======================

Servlets running under vqServer can make use of JDBC without restrictions. 

Many JDBC code samples include a line like 

      Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
      

This line refers to a class which is present in Java Virtual Machines (JVMs)
produced by Sun Microsystems but not in JVMs from other suppliers. If this
class is not present vqServer will not be able to run the servlet properly
and will return an error message. When vqServer is started by invoking
vqServer.exe you are using a Microsoft JVM which does not contain this
class. 

Possible solutions to this problem include: 

[1] If you're using a Microsoft JVM, replace the above line with...
    Class.forName("com.ms.jdbc.odbc.JdbcOdbcDriver"); <=== This worked for
me Mehmet!

[2] or, remove this line from your servlet. The JVM should be able to
determine which JDBC driver is appropriate from those available to it. 
[3] or, use a Sun Microsystems JVM. 


----------------------------------------------------------------------------
----
vqServer version 1.9. Copyright � 1997-2000 Steve Shering and vqSoft. Last
updated 8 October 1999.

===============HELP FILE INFO FROM vqServer ======================



-----Original Message-----
From: Mehmet Gurmen [mailto:[EMAIL PROTECTED]]
Sent: 16 October 2001 21:37
To: [EMAIL PROTECTED]
Subject: Re: ms access driver in a servlet


Attached is the code:
.....
  public void init()
  {
   try{
   Class.forName("sun.jdbc.odbc.JdbcOdbcDriver").newInstance();
   }catch(Exception e){e.printStackTrace();}
  }

 
*****************************************************************

This email has been Virus Scanned.

Privileged/Confidential Information and/or Copyright Material may
be contained in this e-mail. The information and Material is
intended for the use of the intended addressee. If you are not
the intended addressee, or the person responsible for delivering
it to the intended addressee, you may not copy or deliver it to
anyone else or use it in any unauthorised manner. To do so is
prohibited and may be unlawful. If you receive this e-mail by
mistake, advise the sender immediately by using the reply
facility in your e-mail software.


Thank you.
Information Technology Department
Belfast City Hospital Trust

*****************************************************************

Reply via email to