V
visu
Hi!
Following is the code written in myfile.asp which is available in
"www.somesite.com/visu/". The mydb.mdb is available in "visu/db/". This gives
the error report "Microsoft OLE DB Provider for ODBC Drivers error '80004005'
[Microsoft][ODBC Driver Manager] Data source name not found and no default
driver specified
/visu/mydb.asp, line 9 ". Kindly do help me to correct the error.
==========================================
<html>
<head>
<title>My Second ASP Page using a Database</title>
</head>
<body>
<%
Dim adoCon 'Holds the Database Connection Object
Dim rsmydb 'Holds the recordset for the records in the database
Dim strSQL 'Holds the SQL query to query the database
Set adoCon = Server.CreateObject("ADODB.Connection")
strConn="DRIVER={ Microsoft Access Driver
(*.mdb)};DSN="&Server.MapPath("/visu/Db/mydb.mdb")
adoCon.Open strConn
Set rsmydb = Server.CreateObject("ADODB.Recordset")
strSQL = "SELECT tblComments.Name, tblComments.Comments FROM tblComments;"
rsmydb.Open strSQL, adoCon
Do While not rsmydb.EOF
Response.Write ("<br>")
Response.Write (rsmydb("Name"))
Response.Write ("<br>")
Response.Write (rsmydb("Comments"))
Response.Write ("<br>")
rsmydb.MoveNext
Loop
rsmydb.Close
Set rsmydb = Nothing
Set adoCon = Nothing
%>
</body>
</html>--
Thoughts beautiful make the whole being beautiful
Following is the code written in myfile.asp which is available in
"www.somesite.com/visu/". The mydb.mdb is available in "visu/db/". This gives
the error report "Microsoft OLE DB Provider for ODBC Drivers error '80004005'
[Microsoft][ODBC Driver Manager] Data source name not found and no default
driver specified
/visu/mydb.asp, line 9 ". Kindly do help me to correct the error.
==========================================
<html>
<head>
<title>My Second ASP Page using a Database</title>
</head>
<body>
<%
Dim adoCon 'Holds the Database Connection Object
Dim rsmydb 'Holds the recordset for the records in the database
Dim strSQL 'Holds the SQL query to query the database
Set adoCon = Server.CreateObject("ADODB.Connection")
strConn="DRIVER={ Microsoft Access Driver
(*.mdb)};DSN="&Server.MapPath("/visu/Db/mydb.mdb")
adoCon.Open strConn
Set rsmydb = Server.CreateObject("ADODB.Recordset")
strSQL = "SELECT tblComments.Name, tblComments.Comments FROM tblComments;"
rsmydb.Open strSQL, adoCon
Do While not rsmydb.EOF
Response.Write ("<br>")
Response.Write (rsmydb("Name"))
Response.Write ("<br>")
Response.Write (rsmydb("Comments"))
Response.Write ("<br>")
rsmydb.MoveNext
Loop
rsmydb.Close
Set rsmydb = Nothing
Set adoCon = Nothing
%>
</body>
</html>--
Thoughts beautiful make the whole being beautiful