S
slc
Help,
I'm trying to make the following asp code work using a DNS-Less
connection on a windows 2000 server running IIS and ODBC 4.0 driver.
The Access database (odbc_exmp.mdb) was made using Access 2002. The
code works if I set up a DNS on the server under the ODBC drivers.
What I'm I doing wrong and what do I change the code to, to make it
work using DNS-Less connection?
Thanks for any help
Kevin.
<% Response.buffer = true %>
<html>
<head>
<title>Testing of odbc_exmp asp</title>
</head>
<body>
<%
'Next 4 lines do not work
Dim rs, dbPath
dbPath = "c:\safety\tr\odbc_exmp.mdb"
Set rs = Server.CreateObject("ADODB.Connection")
rs.Open "PROVIDER=MICROSOFT.JET.OLEDB.4.0;DATA SOURCE=" & dbPath
' The next 3 lines work with DNS set up on the windows 2000
server-IIS-ODBC 4.0 drivers
'Dim rs
'Set rs = Server.CreateObject ("ADODB.Recordset")
'rs.Open "names", "DSN=odbc_exmp",,, &H0200
While Not rs.EOF
'Response.Write "ID : " & rs("id") & "<br>"
Response.Write "First Name : " & rs("first_name") & "<br>"
Response.Write "Last Name : " & rs("last_name") & "<br>"
Response.Write "<br>"
Response.Write "<br>"
rs.MoveNext
Wend
rs.Close
Set rs = Nothing %>
</body>
</html>
I'm trying to make the following asp code work using a DNS-Less
connection on a windows 2000 server running IIS and ODBC 4.0 driver.
The Access database (odbc_exmp.mdb) was made using Access 2002. The
code works if I set up a DNS on the server under the ODBC drivers.
What I'm I doing wrong and what do I change the code to, to make it
work using DNS-Less connection?
Thanks for any help
Kevin.
<% Response.buffer = true %>
<html>
<head>
<title>Testing of odbc_exmp asp</title>
</head>
<body>
<%
'Next 4 lines do not work
Dim rs, dbPath
dbPath = "c:\safety\tr\odbc_exmp.mdb"
Set rs = Server.CreateObject("ADODB.Connection")
rs.Open "PROVIDER=MICROSOFT.JET.OLEDB.4.0;DATA SOURCE=" & dbPath
' The next 3 lines work with DNS set up on the windows 2000
server-IIS-ODBC 4.0 drivers
'Dim rs
'Set rs = Server.CreateObject ("ADODB.Recordset")
'rs.Open "names", "DSN=odbc_exmp",,, &H0200
While Not rs.EOF
'Response.Write "ID : " & rs("id") & "<br>"
Response.Write "First Name : " & rs("first_name") & "<br>"
Response.Write "Last Name : " & rs("last_name") & "<br>"
Response.Write "<br>"
Response.Write "<br>"
rs.MoveNext
Wend
rs.Close
Set rs = Nothing %>
</body>
</html>