[Microsoft][ODBC Microsoft Driver]

wxdqz

New Member
For starters I'm new to Java.I am using a JFileChooser to select a Access database to open. I'm using aDSN less connection and I can't seem to figure out what I'm doing wrong Ikeep getting this error message. [Microsoft][ODBC Microsoft Driver]'(unknown)' is not a valid path. Make sure that the path is spelledcorrectly and that you are connected the server on which the file residesSQL state:S1009 Vender code: -1023.This is my Connection string.String url = "jdbc:eek:dbc:Driver={Microsoft Access Driver (*.mdb)};DBQ=" +returnedFile.getPath() + "\\" + returnedFile.getName();Connection cnConnection = DriverManager.getConnection(url );The variable returnedFile is file object returned from the JFileChooser'sgetSelectedFile() method.I was thinking that returnedFile.getPath() string has a single \ and thatI might have to find every \ and replace it with "\\".Some examples of the connection string the path where the .mdb file islooks like "C:/folder1/folder2/somedb.mdb"why on a windows os would the path have forward slashes??Any help or advise would be greatly appreciated.Thanks
 
Top