Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations wOOdy-Soft on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Local ODBC Connection to MS Access

Status
Not open for further replies.

scripter50

IS-IT--Management
Dec 9, 2002
35
US
I'm trying to get a connection to a local MS Access from an ASP page, but getting a "Data Source Name cannot be found.." This is just for development.

System DSN is named "Image", no userid or pwd set:

set conn = Server.CreateObject("ADODB.Connection")
conn.open "DSN = Image"
sql = "SELECT * from contacts"
set rs = conn.execute(sql)
if not rs.eof then
sFirst = rs("first")
end if
set rs = nothing

I've tried DSN & DSNless, but no luck! Any ideas?

Thanks in advance,
scripter50
 
sounds there you have no DSN on the odbc link

use this DNSless connection below

Code:
set conn1 = Server.CreateObject("ADODB.Connection")
DSNtemp="DRIVER={Microsoft Access Driver (*.mdb)}; "
DSNtemp=dsntemp & "DBQ=" & server.mappath("filename.mdb")
conn1.Open DSNtemp
 
Thanks nicklieb, I give it a try. I work with Oracle 9i, SQLServer 2000, and MySQL and have never had to deal with Access, but I've got a new client whose ISP only supports Access (yuck!).
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top