This discussion is archived
1 Reply Latest reply: Dec 13, 2006 7:56 AM by 800322 RSS

Ms Access DB connection

807607 Newbie
Currently Being Moderated
hi ,
i wrote a program in java
to connect Ms Access
public Connection connect()
     {
          Connection conn=null;
                    Class.forName("sun.jdbc.odbc.JdbcOdbcDriver").newInstance();
                    conn = DriverManager.getConnection("jdbc:odbc:;DRIVER=Microsoft Access Driver (*.mdb);DBQ=expences.mdb");
                    return conn;
}
it works fine as an individual JAVA program ie., wen i execute it using
main it works fine

the problem is wen i try to run in the web module
ie, i wrote a servlet and try to call the function

i throws exception
SQL exception: cannot find the file "<unknown>"


i used same file path and same package.
the thing is it is not working we i called it in servlet

please help me.,