User Name Password Register
DaniWeb IT Discussion Community
All
What is DaniWeb IT Discussion Community?
You're currently browsing the MS Access and FileMaker Pro section within the Web Development category of DaniWeb, a massive community of 402,476 software developers, web developers, Internet marketers, and tech gurus who are all enthusiastic about making contacts, networking, and learning from each other. In fact, there are 2,918 IT professionals currently interacting right now! Registration is free, only takes a minute and lets you enjoy all of the interactive features of the site.
Please support our MS Access and FileMaker Pro advertiser: Programming Forums

ODBC setup with Online Access DB

Join Date: May 2005
Posts: 1
Reputation: chrismogz is an unknown quantity at this point 
Rep Power: 0
Solved Threads: 0
chrismogz chrismogz is offline Offline
Newbie Poster

Re: ODBC setup with Online Access DB

  #5  
May 10th, 2005
hello, am trying to access the DB like you said above but i keep getting the following message: with

Connection databaseConnection = DriverManager.getConnection("jdbc:odbcriver={MicroSoft Access Driver (score.mdb)};DBQ=//www.monaghan-c.co.uk/java/score.mdb");

java.sql.SQLException: [Microsoft][ODBC Driver Manager] Data source name not found and no default driver specified

or change the {MicroSoft Access Driver (score.mdb)} to {MicroSoft Access Driver (*.mdb)} i get
java.sql.SQLException: [Microsoft][ODBC Microsoft Access Driver] Disk or network error.

The db is at that address and host supports the db. Please could any one help me out with this problem . the full code for the class is below:


import javax.swing.JOptionPane;




import java.sql.SQLException;
import java.lang.*;
import java.sql.*;


public class Main
{

public static void main(String[] args)
{
try {



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

// String sourceURL = new String("jdbc:odbc:score");




Connection databaseConnection = DriverManager.getConnection("jdbc:odbcriver={MicroSoft Access Driver (score.mdb)};DBQ=//www.monaghan-c.co.uk/java/score.mdb");

Statement statement = databaseConnection.createStatement();
ResultSet score = statement.executeQuery("SELECT User-Name, Score FROM scoreboard");

while(score.next()) {
System.out.println(score.getString("User-Name")+" "+score.getString("Score"));
}

}catch(ClassNotFoundException cnfe) {
System.err.println(cnfe);
}catch(SQLException sqle){
System.err.println(sqle);

GameControl.newGame();

}
}

}


thanks for your time

chris mon
Reply With Quote  
All times are GMT -4. The time now is 4:35 pm.
Forum system based on vBulletin Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
©2003 - 2008 DaniWeb® LLC