Forum Moderators: open

Message Too Old, No Replies

Dreamweaver 8 and Database Connection

help!

         

humpg

7:39 pm on Oct 15, 2008 (gmt 0)

10+ Year Member



I am creating an asp site and I have created a custom database connection and tested and it was succesfull in dreamweaver and it created the following page in a Connections folder:

<%
Dim MM_conn_Core_STRING
MM_conn_Core_STRING = "Provider=Microsoft.Jet.OLEDB.4.0;DATA SOURCE=" & Server.MapPath("..\db\someDB.mdb")
%>

I used this connection in a page above this folder to create a recordset and to display some dynamic data but when viewing on my localhost it says the path to the db is invalid.

So if I change the connection to:

Dim MM_conn_Core_STRING
MM_conn_Core_STRING = "Provider=Microsoft.Jet.OLEDB.4.0;DATA SOURCE=" & Server.MapPath("db\someDB.mdb")
%>

Then it works in the browser but then my connection is not succesful in dreamweaver.

So here is the setup:

page.asp

Connections/connect.asp (Created by Dreamweaver when setting up connection)

db/someDB.mdb

So how do I get this path to work so it satisfies both dreamweaver and the browser?

rocknbil

10:46 pm on Oct 15, 2008 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



My VB coding is getting a bit of rust on the undersides, but from what I remember, this is similar to when people put the server directory separator in/their/local/pages/ - just worse. :-)

See if you can use the full path?

C:\directory\to\db\somedb.mdb

humpg

12:22 am on Oct 16, 2008 (gmt 0)

10+ Year Member



I could do that, but I thought this might be the better way because when uploading to a remote host or changing locations then I wouldn't have to worry about changing the code.