-
Opening database in ASP
I'm a bit new with ASP...
Well, I can use the Request object, the Response object, but when it comes down to databases, I'm a goner.
I have the code that I want executed and it will work, but how do I refrence a database without a DSN? I just have the file (trivia.mdb) but have trouble refrencing it with:
recSrc = " Driver={Microsoft Access Driver (*.mdb)};DBQ=trivia.mdb"
I know that the MDB is in the same dir as the ASP (c:\inetpub\wwwroot\games\tokentag\) and I know it's http path too (http://starwars/games/tokentag/), so how would I go about doing this?
-
Try using a DSN-less connection like this:
Code:
objConn.ConnectionString = "DRIVER={Microsoft Access Driver (*.mdb)};" & "DBQ=" & Server.MapPath("trivia.mdb")
-
SWEET!
It actually works!
So, Server.MapPath turns the enclosed string into the virtual path, so that it can read the database right?
-