Skip to main content
Participant
April 3, 2006
Question

Server.Mappath and _mmServerScripts problem

  • April 3, 2006
  • 2 replies
  • 654 views
Ok my problem is simple I know how to work with it but I'm sure there has to be a fix or its a bug.
Using dreamweaver 8, and this connection string...

"Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & Server.MapPath("ce_db.mdb")

it keeps telling me that D:\path\path2\_mmServerScripts\ce_db.mdb is not found
(duh of course i dont have it there, its here D:\path\path2\ce_db.mdb)
it runs fine on the website though!

now i do this Server.MapPath("../ce_db.mdb")
and it works in dreamweaver but the website tells me this

Microsoft JET Database Engine error '80004005'

Could not find file 'd:\path\ce_db.mdb'.

the only way i found to fix it its to change the connection everytime im done working with the database but that sucks

anyone knows how to fix it?
This topic has been closed for replies.

2 replies

os_84Author
Participant
April 17, 2006
so no one knows?
Participant
April 17, 2006
I have found that when developing locally, Dreamweaver (versions 6, 7, and 8) does not like the Server.MapPath. I always connect with an absolute path like so:

MM_products_STRING = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=c:\inetpub\wwwroot\man\products.mdb;"

(changing whatever your path and string name is)

Then, I go into my connections folder, add the relative (Server.MapPath) string, making sure I comment it out. When I am ready to upload to my server, I then un-comment the relative string and comment out the absolute string.

As far as your relative path, you may want to try it as:

"Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & Server.MapPath("../ce_db.mdb")

this way you're telling the script to look one folder higher than the _mmServerScripts folder DW is looking for.

Please advise if this is clear as mud or clear as crystal. Good luck and keep coding!
Inspiring
April 4, 2006
Have you tried a site-root relative path? For example:

Server.MapPath("/ce_db.mdb")

Hope this helps,
Randy


> Ok my problem is simple I know how to fix it but Im sure there has to be a fix.
> Using dreamweaver 8,
> and this connection string...
> "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & Server.MapPath("ce_db.mdb")
> it keeps telling me that D:\path\path2\_mmServerScripts\ce_db.mdb is not found
> (duh of course i dont have it there)
> it runs fine on the website though!
>
> now i do this Server.MapPath("../ce_db.mdb") and the website tells me this
>
> Microsoft JET Database Engine error '80004005'
>
> Could not find file 'd:\path\ce_db.mdb'.
>
> the only way i found to fix it its to change the connection everytime im done
> working with the database but that sucks
os_84Author
Participant
April 4, 2006
that didnt work... gave me another directory