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

ASP password on MS ACCESS using ServerMappath

Status
Not open for further replies.

Almarton

Programmer
Jan 1, 2002
42
BR
Does anyone know what is wrong with this code:

dsn = "Driver={Microsoft Access Driver (*.mdb)};" & "DBQ=" & Server.Mappath("users.mdb") & ";PWD=456456"

because this works perfectly:

dsn = "Driver={Microsoft Access Driver (*.mdb)};" & "DBQ=d:\inetpub\database\empresas\barrasol\users.mdb;" & "PWD=456456"

Thanks for the help!
Almarton

Alexandre @lmarton Marton
almarton@task.com.br
 
try a response.write (Server.Mappath("users.mdb"))

Does it give you same path? - The Server.MapPath method is dependend upon the directory of the current script so for example,

Server.Mappath(".") will give the directory of the current script. If you access database is in an embedded folder your script will not be able to find it.

Try putting your access database in teh same folder as your connection script.

Hope this helps,

BDC.
 
The DB can be accessed normally if I take out the password from the code and from the DB, the path is right. So the problem seems to be the code syntax for sending password. I just don't know the right one though.

Alexandre @lmarton Marton
almarton@task.com.br
 
See thread329-524716 because you may be encountering a very similar problem. I suspect that ADO parsing of connection strings is much the same for ODBC and OLEDB, so the same thing might be "biting" you.

Can't hurt to give it a try!
 
Dear dilettante and others;
(thread329-524716)

Thanks for the tip on the thread above,
was up to now the one that made the most
sense but it does not work either, neither
of your options...

It seems that the only way to access the DB
using PWD is throught the string:

dsn = "Driver={Microsoft Access Driver (*.mdb)};" & "DBQ=d:\inetpub\database\empresas\barrasol\AES.mdb;" & "PWD=456456"

and the other one only works if the db is not pwd protected:

dsn = "Driver={Microsoft Access Driver (*.mdb)};" & "DBQ=" & Server.Mappath("AES.mdb") & ";"

THERE IS NOTHING TO DO WITH PATH, but it sure have
some to do with syntax, but what is it remains unknown!

Thanks
Alex.


Alexandre @lmarton Marton
almarton@task.com.br
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top