DSN Less Connections without full path

Results 1 to 2 of 2

Thread: DSN Less Connections without full path

  1. #1
    Join Date
    Dec 1969

    Default DSN Less Connections without full path

    Our webhost only provides us with one DSN and I would like to set up another database. I am trying to set up a DSN less connection like this:<BR><BR>&#060;%<BR>strConnect = "Driver={Microsoft Access Driver (*.mdb)}; DBQ=/userinfo.mdb"<BR>%&#062; <BR><BR><BR>I don&#039t have the full pathname (C:wwwetc...) and I am wondering if there is a way I can point to this access database without it.<BR><BR>Thanks,<BR>Pete<BR>

  2. #2
    Shawn Berg - IWM Guest

    Default RE: DSN Less Connections without full path

    Instead of using:<BR><BR>&#060;%<BR>strConnect = "Driver={Microsoft Access Driver (*.mdb)}; DBQ=/userinfo.mdb"<BR>%&#062; <BR><BR>Use,<BR><BR>&#060;%<BR>strConnect = "Driver={Microsoft Access Driver (*.mdb)}; DBQ=" & server.MapPath("/userinfo.mdb")<BR>%&#062; <BR><BR>If the database&#039s virtual path is "/usernifo.mdb" then this will work. The server.MapPath command will return the true path to the file which is what the connectino string reads. You can do a:<BR><BR>&#060;%<BR>Response.Write(server.MapPath ("/userinfo.mdb")) <BR>%&#062;<BR><BR>This will show you what your full file path is.<BR><BR>

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts