Copy link to clipboard
Copied
Hello All,
I am taking a Coldfusion class and hav completed the projects. The problem is that the database works fine on my PC but when uploaded to the school's server there is always an error (such as (Datasource studentinfo could not be found) when I access the page on the school's server. The teacher said I did not properly name the database. Any ideas on "how to properly name the db"?
Thank you,
Copy link to clipboard
Copied
My opinion is different than your teacher's.
There are two prerequisites for a datasource to be recognized. First, the database has to be made available to ColdFusion. Second, a datasource has to be set up on ColdFusion by the Administrator.
Were both steps done?
If so, does datasource "studentinfo" point to your database?
Copy link to clipboard
Copied
Dan, thanx for your response. The datasource was set on conldfusion8 via the admin login on my local computer so it works fine, however, this is not the case for the school server because I simply uploaded the assignments and projects to the school server without the ability for me to create the datasource on the school server. Although in each student's Database folder on the school server there is a DSNXXXX.mdb file, I'm not sure if this file is supposed to specify the datasource per student. Any ideas?
Copy link to clipboard
Copied
Here is one of the errors;
The web site you are accessing has experienced an unexpected error.
Please contact the website administrator.
The following information is meant for the website developer for debugging purposes. | |||||||||||||||||||||||||||
Error Occurred While Processing Request | |||||||||||||||||||||||||||
|
Copy link to clipboard
Copied
I neither work at your school nor am I a student. Therefore I don't know what instructions you were given.
In this thread though, you say that you were told that you didn't name your database correctly. You also say that you are given a database named DSNXXX.mdb to use.
My interpretation is that the school set you up properly. Your database tables should be in the mdb file provided, and in your cfquery tags, your dsn is probably dsnxxx, or just xxx.
Copy link to clipboard
Copied
I missed a couple of classes due to flu and the teacher is giving me a hard time instead of directing to what I may be missing. Although the DSNXXX.mdb file does not seem to contain anything when I open it in Office Access, where and how would I use the DSNXXX.mdb in the cfquery tags? Here is my signup.cfm code;
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Untitled Document</title>
</head>
<body>
<cfquery name="qgetguests" datasource="signup">
select FirstName, LastName, Email
from signup
order by FirstName;
</cfquery>
<table style="margin-top:40px; width:30%" border="1" cellpadding="0" cellspacing="0" align="center">
<tr>
<th>First Name</th>
<th>Last Name</th>
<th>Email</th>
</tr>
<cfoutput>
<tr>
<td align="center">#qgetguests.FirstName#</td>
<td align="center">#qgetguests.LastName#</td>
<td align="center">#qgetguests.Email#</td>
</tr>
</cfoutput>
</table>
</body>
</html>
Copy link to clipboard
Copied
From your response so far, I am getting the idea that I need to move all my database tables into the DSNXXX.mdb file and make datasource="DSNXXX". Is this correct?
Copy link to clipboard
Copied
Moving all your tables to the dsnxxx.mdb file makes sense.
As far as your coldfusion dsn name goes, you either use trial and error or ask the school.
Copy link to clipboard
Copied
Hey Dan, That is what it is. I moved all my tables to the DSNXXX.mdb file and made datasource="DSNXXX" (XXX is my student # in the class). Thanx a lot.