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 strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

MS Access DSNLess Connection

Status
Not open for further replies.

zzfive03

Programmer
Jun 11, 2001
267
Hello, this thing is turning out to be a huge pain.
I usualy use SQL server, so Access is new to me. I need to connect to my MS Access server across a DSNLess connection via ASP.

Here is what I have:
Dim DB, RS, DSNString
Set DB = Server.CreateObject("adodb.connection")
Set RS = Server.CreateObject("adodb.recordset")
DSNString="DRIVER={Microsoft Access Driver (*.mdb)};" & "DBQ=" & server.mappath("MyDatabase.mdb")
DB.Open DSNString

It works if I comment out the last line. then, how do i Run my SQL = "select * from {table}"?

Thanks for your help
 
try it this way.

DSNString = "PROVIDER=Microsoft.Jet.OLEDB.4.0;" & "Data Source=" & server.mappath("myDatabase.mdb")

DB.Open DSNString
RS.open SQL, DB

Work for me maybe it will work for you.
 
Remove the curly brackets {} from around the driver.
codestorm
Fire bad. Tree pretty. - Buffy
select * from population where talent > 'average'
<insert witticism here>
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top