This topic is locked

Database connection

11/14/2003 1:03:43 PM
ASPRunnerPro General questions
TheCapt author

I have set-up asp runner successfully and have tested on my web site database and all works fine. However, I keep my databases in a secure folder called "Private" and my web files in a folder called "htdocs".
In order to keep my database secure I would like to point the dbconnection.asp file to the private subdirectory rather than the db folder that asprunner automatically generates copying my databse file.
Can someone please let me kow if this is possible and if so what would be the string connection to use. I tried changing the existing db/mydatabase.mdb to private/mydatabase.mdb with little success.
The file site structure for asprunner and the location of my database is as follows:
/private/mydatabase.mdb

/htdocs/admin/db/mydatabase.mdb

/htdocs/admin/images/all files

/htdocs/admin/include/all files

/htdocs/admin/login.asp etc..
regards
TheCapt

Sergey Kornilov admin 11/15/2003

TheCapt,
try this connection string:

strConnection = "Provider=MSDataShape;DRIVER={Microsoft Access Driver (*.mdb)};DBQ=" & server.mappath("/private/mydatabase.mdb") & ";UID=;PWD="


I hope this helps.
Best regards,

Sergey Kornilov

TheCapt author 11/15/2003

Sergey,
I changed the db string as suggested, uploaded and got this error message:
ASP error happened
Technical information

Error number -2147467259
Error description [Microsoft][ODBC Microsoft Access Driver]General error Unable to open registry key 'Temporary (volatile) Jet DSN for process 0xeb4 Thread 0xf68 DBC 0x1550064 Jet'.
URL /newepsom/htdocs/admin/chamber_login.asp
Can you help?
Regards
TheCapt

TheCapt author 11/15/2003

Sergey
Success. What I needed to do was use the following database connection string
"../../private/mydatabase.mdb" and it worked fine.
I obtained this information from my service provider.
Strange but true
Best Regards
TheCapt