Have setup several ODBC links to local access DBs, and thought it would be just as simple wanting to link to an Access DB stored on my personal webspace, but no...

Asks for username / password when I type in the url of the online DB in the ODBC setup, and it doesn't accept the username/pwd that I have for the webspace. And insists on putting the webspace url in the username box every failed login attempt.

Is it that my isp webspace simply doesn't allow it, or am I missing something?

Your hosting Probably doesnt have an access driver on thier system!
On your local computer you (i am sure) have access installed on your computer.
what error text is generated?

Yup came to the same conclusion, so looked around for some webspace that supports it, still can't get it working though. I'm guessing this is the correct way of doing it:

String url = "jdbc:odbc://www.websamba.com/myspace/DSNname";

Error: Cannot connect to the database.java.sql.SQLException: [Microsoft][ODBC Driver Manager] Data source name not found and no default driver specified

I'm using www.websamba.com as they boosted free space, and free setup of ODBC System DSN, but after setting up the DSN for my DB I can't get it to work.

Will send a reward over Paypal to anyone who can get it working! =/

Finally got it working after about 4-5 weeks of trying, 6 different types of error, using 3 different websites...

If anyone is interested this is how you can connect to an Access .mdb file stored on a website, without a DSN. This is the code...


Database = DriverManager.getConnection("jdbc:odbc:Driver={MicroSoft Access Driver (*.mdb)};DBQ=//www.website.com/yourfolder/YourDB.mdb","ID","PW");


(Note that the website used must support the access and storage of .mdb files, and the above code must use the actual address rather than a masked address, for example users.website.com instead of www.website.com)

hello, am trying to access the DB like you said above but i keep getting the following message: with

Connection databaseConnection = DriverManager.getConnection("jdbc:odbc:Driver={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:odbc:Driver={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

Hello Guys,

I just found this thread through google, and wanted to add to what you guys already said that Instead of entering WWW URL's, you may also use server path to the file in question. To find out about your server variables, here is what you do:

1- Create a blank file and save it as "serverinfo.asp".

2- Enter the following code in that file to get all your server variables:

<div align="left">
<table border="0" cellpadding="0" cellspacing="0" width="750">
<tr>
<td valign="top" align="left" width="150"><font face="Arial" size="2" color="#FF0000"><b>Variable Name</b></font></td>
<td valign="top" align="left" width="600"><font face="Arial" size="2"><b>Value</font></b></td>
</tr>
<%
for each name in request.servervariables
%>
<tr>
<td valign="top" align="left" width="150">
<font face="Arial" size="1" color="#FF0000">
<%= name %></font></td>
<td valign="top" align="left" width="600">
<font face="Arial" size="1"><%= request.servervariables(name) %></font></td>
</tr>

<%
Next
%>
</table>
</div>

3- Look up the server variable for Path to your directory, where the ".mdb" file is at. It will be something like this:

C:/Inetpub/wwwroot/test.mdb

4- Use the connection string to connect to the database:

<%
dim cnn,rst
set cnn = Server.CreateObject("ADODB.Connection")
set rst = Server.CreateObject("ADODB.RecordSet")
cnn.Open "driver={Microsoft Access Driver (*.mdb)};;DBQ=C:/Inetpub/wwwroot/test.mdb;"
sqltext = "SELECT * FROM test"
rst.Open sqltext,cnn,3,3
%>

That's it! Again, thank you all for the initial thread. Very useful information.

Pete

1. How do i make a File were members can Register to the page and Do i need a database for this.

2. when making a online game do i need a Javascript.

3, in making a Database Do I need a server to or can I add a database to my FTP site.

4. Really new at this so its kind of comfusing I dont really know what all i need to make the game up and running far as Register, and a file that let the game know when a person has logged in to be able to change Stats.

If u would like to help your more then welcome!!!!!!! <EMAIL SNIPPED>

Thank you for all the messages.

I tried using the following code (with proper user_id and pwd):

connection = DriverManager.getConnection("jdbc:odbc:Driver={MicroSoft Access Driver (*.mdb)};DBQ=//www.sivameyeclinic.com/www/Sivam_dev.mdb","user id","pwd");

but, get the message as:
java.sql.SQLException: [Microsoft][ODBC Microsoft Access Driver] '(unknown)' is not a valid path. Make sure that the path name is spelled correctly and that you are connected to the server on which the file resides.

I have the file Sivam_dev in www folder created for placing all the html files.

Could you please let me know what could be the problem.

Any small amount of guidance in this regard will be very much appreciated.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.