Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

Server.Mappath and _mmServerScripts problem

New Here ,
Apr 03, 2006 Apr 03, 2006
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?
TOPICS
Server side applications
656
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Apr 03, 2006 Apr 03, 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
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Apr 04, 2006 Apr 04, 2006
that didnt work... gave me another directory
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Apr 17, 2006 Apr 17, 2006
so no one knows?
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
Apr 17, 2006 Apr 17, 2006
LATEST
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!
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines