Click to See Complete Forum and Search --> : MORE problems!


solafide
12-13-2004, 11:09 PM
I have really benefitted from you guys, especially buntine. But after all those elementary problems, my asp file says:

Microsoft OLE DB Provider for ODBC Drivers error '80004005'

[Microsoft][ODBC Driver Manager] Data source name not found and no default driver specified

/words.asp, line 5

<%@LANGUAGE="JAVASCRIPT" CODEPAGE="1252"%>
<%
var dbase=Server.CreateObject('ADODB.Connection');

dbase.Open("DBQ=" + Server.MapPath("words.mdb") + ";" +
"Driver={Microsoft Access Driver(*.mdb)}");
var wordid=Math.floor(Math.random*600)
var rightans=Math.floor(5*Math.random());
var choiceid=new Array(Math.floor(600*Math.random()), Math.floor(600*Math.random()), Math.floor(600*Math.random()), Math.floor(600*Math.random()));
choiceid[rightans]=wordid;
%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<title>Words</title>
</head>

<body>
<script language="javascript">
function right()
{alert('You are right!');}
function wrong()
{alert('You are not right.');}
</script>
<p>What does
<%dbase.execute("SELECT DISTINCT id, words FROM words WHERE id=" + wordid)%>
mean?
</p>
<table border="1" cellspacing="2" cellpadding="1">
<tr>
<td><% if (0 || 4)==rightans {%><a href="javascript:right()"><%} else {%> <a href="javascript:wrong()"><%}; dbase.execute("SELECT DISTINCT id, words FROM words WHERE id=" + choiceid[0]);%></a></td>
</tr>
<tr>
<td><% if 1==rightans {%><a href="javascript:right()"><%} else {%> <a href="javascript:wrong()"><%}; dbase.execute("SELECT DISTINCT id, words FROM words WHERE id=" + choiceid[1]);%></a></td>
</tr>
<tr>
<td><% if 2==rightans {%><a href="javascript:right()"><%} else {%> <a href="javascript:wrong()"><%}; dbase.execute("SELECT DISTINCT id, words FROM words WHERE id=" + choiceid[2]);%></a></td>
</tr>
<tr>
<td><% if 3==rightans {%><a href="javascript:right()"><%} else {%> <a href="javascript:wrong()"><%}; dbase.execute("SELECT DISTINCT id, words FROM words WHERE id=" + choiceid[3]);%></a></td>
</tr>
</table>
</body>
</html>



Thanks a ton!

Billy

russell
12-14-2004, 01:55 AM
is words.mdb in the same directory as the asp file? if not, you'll need to pass the relative path of the db to the MapPath() function.