fritz_the_blank
asked on
ASP Access Connection
To connect to an Access database back end in an ASP, I use the following code:
dim conn
set conn =Server.CreateObject("ADOD B.Connecti on")
conn.Open "DSN=testconnect","admin", "admin"
dim rs 'record set
dim sql 'sql statement
set rs = Server.CreateObject("ADODB .RecordSet ")
sql = "Select * from Addresses"
rs.Open sql, conn
"testconnect" is configured as an ODBC connection in the "ODBC Data Sources" control panel with the Access driver.
When I run this on my Windows 98 machine using personal web server, it works perfectly. However, when I place all of the files (including the database) on an NT Server running IIS and create the appropriate ODBC profile, I get the following error:
Microsoft OLE DB Provider for ODBC Drivers error '80004005'
[Microsoft][ODBC Driver Manager] Data source name not found and no default driver specified
Any other ASP in this directory runs fine as long as it does comprise a data connection.
Any advice would be greatly appreciated.
Fritz the Blank
dim conn
set conn =Server.CreateObject("ADOD
conn.Open "DSN=testconnect","admin",
dim rs 'record set
dim sql 'sql statement
set rs = Server.CreateObject("ADODB
sql = "Select * from Addresses"
rs.Open sql, conn
"testconnect" is configured as an ODBC connection in the "ODBC Data Sources" control panel with the Access driver.
When I run this on my Windows 98 machine using personal web server, it works perfectly. However, when I place all of the files (including the database) on an NT Server running IIS and create the appropriate ODBC profile, I get the following error:
Microsoft OLE DB Provider for ODBC Drivers error '80004005'
[Microsoft][ODBC Driver Manager] Data source name not found and no default driver specified
Any other ASP in this directory runs fine as long as it does comprise a data connection.
Any advice would be greatly appreciated.
Fritz the Blank
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Hey Fritz,
1. Check that it is a
SYSTEM DSN and not a USER DSN
2. Check the dsn name for case sensitivity:
"TestConnect" <> "testconnect"
Cheers, Paul
1. Check that it is a
SYSTEM DSN and not a USER DSN
2. Check the dsn name for case sensitivity:
"TestConnect" <> "testconnect"
Cheers, Paul
Hi Fritz the Blank,
Try the below scripts:
1.
<%
set conn=Server.CreateObject(" ADODB.Conn ection")
fpath="DBQ="&Server.MapPat h("/databa sename.mdb ")
dpath="Driver={Microsoft Access Driver (*.mdb)};"
conn.Open dpath&fpath
set rs=Server.CreateObject("AD ODB.Record set")
%>
2.
This code need to set the DSN.
<%
set conn=Server.CreateObject(" ADODB.Conn ection")
conn.Open "DSN=supercorridor;UID=use rname;PWD= password"
set rs=Server.CreateObject("AD ODB.Record set")
%>
good luck
by
skhan88
Try the below scripts:
1.
<%
set conn=Server.CreateObject("
fpath="DBQ="&Server.MapPat
dpath="Driver={Microsoft Access Driver (*.mdb)};"
conn.Open dpath&fpath
set rs=Server.CreateObject("AD
%>
2.
This code need to set the DSN.
<%
set conn=Server.CreateObject("
conn.Open "DSN=supercorridor;UID=use
set rs=Server.CreateObject("AD
%>
good luck
by
skhan88
ASKER
Comment accepted as answer
ASKER
This not only allowed the project to function on NT but it also sped things up somewhat.
Thanks a bunch!
Fritz the Blank
Thanks a bunch!
Fritz the Blank
Glad I could help, I never use DSN's anymore, the ole connection string is easier to administrate and as a plus it's a bit faster....take care.
Regards,
Shannon Harmon
Regards,
Shannon Harmon
make sure that dsn name that you created points to that database, also check the name correctly. have you explicitly set the pws to admin ? if not remove it althogether.
conn.Open "DSN=testconnect","admin",