Access dbase connection string errors

J

J. Muenchbourg

I keep getting
"Unable to open registry key 'Temporary (volatile) Jet DSN "
errors pointing to my connection string when the same connection string
is working for a few of my other pages. The MSAccess database does have
the right permissions configured. Below is code I'm using:

<%
dbcon="DBQ=" & Server.Mappath("diary.mdb") & ";Driver={Microsoft Access
Driver (*.mdb)};"
Set calConn = Server.CreateObject("ADODB.Connection")
calConn.Open dbcon%>
<%dim freetsql,rsfree
freetsql = "select text_field from diary where dte ='" & dfm & "'"
set rsfree = Server.CreateObject("ADODB.Recordset")
rsfree.Open freetsql,calConn,3 %>


???
Muench
 
R

Ray at

Do not keep your mdb file in your website's directory structure. I.E.


Physical path on server to .htm/.asp files:
D:\Websites\Website1


Put mdb databases elsewhere, like:
D:\Databases\Website1\diary.mdb

When you do that, your Server.MapPath will no longer work, since that will
no longer be the path to your DB, but I think that's a minor tradeoff. You
could keep the path to your DB in an application variable or a global
constant. More on this topic can be found at:
http://www.aspfaq.com/2454
http://groups.google.com/[email protected]

Ray at work
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,769
Messages
2,569,579
Members
45,053
Latest member
BrodieSola

Latest Threads

Top