Web Database Connection String assistance required…

  • Thread starter Thread starter Appalachia
  • Start date Start date
A

Appalachia

Hi

I have inherited a web site with an Access database in it.

My host requires that I move the .mdb to an external folder –

d:\websites\username\data\mydb.mdb

The current Connection String goes to a directory ‘fpdb’ (probably because
the FrontPage Extensions allow read/write?)

The current string =

<% dim strconnect ,strPath
strPath=server.MapPath("/fpdb/mydb.mdb")
strconnect="DRIVER={Microsoft Access Driver (*.mdb)}; DBQ=" & strPath %>

Would I change it to this? -

<% dim strconnect ,strPath
strPath=server.MapPath("d:\websites\username\data\mydb.mdb")
strconnect="DRIVER={Microsoft Access Driver (*.mdb)}; DBQ=" & strPath %>

I’m so worried about the quotes and messing it up.

Any help much appreciated.

SGC
 
The mapPath function returns a physical path from a virtual (web site) path.
In your case, your host is giving you directly the physical path to use, so
you drop the call to the mapPath function:

strPath="d:\websites\username\data\mydb.mdb"

I suppose that you must also replace the name of the repertory 'username'
with your own username.

--
Sylvain Lafontaine, ing.
MVP - Windows Live Platform
Email: sylvain2009 sylvainlafontaine com (fill the blanks, no spam please)
Independent consultant and remote programming for Access and SQL-Server
(French)
 
ThNKA

Do I keep the parts before amd after it?

e.g.

<% dim strconnect ,strPath
strPath="d:\websites\username\data\mydb.mdb"
strconnect="DRIVER={Microsoft Access Driver (*.mdb)}; DBQ=" & strPath %>

I have very little experience with programming so I need full intruction,
please.

SGC
 
Back
Top