Database connection

Results 1 to 3 of 3

Thread: Database connection

  1. #1
    Big Al Guest

    Default Database connection

    is there a way when writing a DNS-less connection to not have to write the full path. <BR><BR>from this <BR>DBcon = "Driver={Microsoft Access Driver (*.mdb)};DBQ=d:inetpubwwwhostskeymswww_testdatabas eclassified.mdb"<BR><BR>to something like this <BR>DBcon = "Driver={Microsoft Access Driver (*.mdb)};DBQ=databaseclassified.mdb"<BR>

  2. #2
    Join Date
    Dec 1969

    Default RE: Database connection

    Yes - you could use Server.MapPath("clasified.mdb") in place of the file reference, but this slows the process down in connecting to your database and should only be recommended if you do not know the physical path on the server (for example if your server is from a host company).<BR><BR>A better solution is to write the full path out once with all of your connection details and save it in a page called connection.asp, then in future everytime you need a database connection just write this at the top of your page:<BR><BR>&#060;!-- #INCLUDE FILE="Connection.asp" --&#062;

  3. #3
    Big Al Guest

    Default Thanks

    Chears for that I have got the connection in a file. but I was going to change servers and was just try ing to skip doning more work. <BR>thanks for the tip on slowing the server down....

Posting Permissions

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