Connecting to my Access Database

Results 1 to 4 of 4

Thread: Connecting to my Access Database

  1. #1
    Join Date
    Dec 1969

    Default Connecting to my Access Database

    Hi there!<BR><BR>I just FTP&#039;d my ASPage to my web host, but when it run it, it can&#039;t connect to my Access Database. Could you look at my "connect to database code" and see if I&#039;m doing anything wrong??<BR><BR>The Facts:<BR><BR>1) I&#039;ve FTP&#039;d the database to the main directory of my web host.<BR>So, the database "EmailProject.mdb" is with all the HTML and ASP&#039;s on my web host.<BR><BR>2) It was working on my local machine before I uploaded it to my web host.<BR><BR>This is the code I have:<BR><BR>&#060;%<BR>SET conn = server.createobject("ADODB.Connection")<BR>conn.Co nnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source="EmailProject.mdb"<BR><BR>%&#062;< BR><BR>I&#039;d appreciate any input that you might have!!<BR>Thank you! :)<BR>Andrea<BR>

  2. #2
    Join Date
    Dec 1969

    Default RE: Connecting to my Access Database

    you will have to use the Server.MapPath method of deriving the path of your database on the server. I am not sure of the exact syntax, but if you do a search in the Database Section for Server.MapPath, you should get the correct syntax<BR><BR>mj<BR>

  3. #3
    David Moran Guest

    Default RE: Connecting to my Access Database

    Try this:<BR><BR>"PROVIDER=Microsoft.Jet.OLEDB.4.0; Data Source=" & _<BR> Request.ServerVariables("APPL_PHYSICAL_PATH") _ & "EmailProject.mdb"

  4. #4
    Redth Guest

    Default RE: Connecting to my Access Database

    Ok, that code works nice, but im developing a script for free distribution, so that should allow most people to connect to the database without specifying the path to the database file? what about a virtual path? would that better suit my needs?<BR><BR>any other suggestions??? would it be possible to make a variable on my configure page that they could put the path in there if they were having trouble? <BR><BR>thanks for suggestions...!

Posting Permissions

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