Data Connection Include

Results 1 to 2 of 2

Thread: Data Connection Include

  1. #1
    Jason Guest

    Default Data Connection Include

    I have an include file that has my data connection string,<BR><BR>&#060;%<BR> strconn="PROVIDER=Microsoft.Jet.OLEDB.4.0;DATA SOURCE="<BR> strconn=strconn & server.mappath("database/db.mdb") ";"<BR>%&#062;<BR><BR>This include file resides in a folder right off the root directory. The ASP pages that I have created so far all are located off the root directory too. I have created a new folder (Admin) with ASP files in that location. Now when I call the above include, the path to the database is not correct. How can I set this up so no matter where I call the include, the path will be correct?<BR><BR>Thanks

  2. #2
    Join Date
    Dec 1969

    Default You would be better off..

    ...storing your connection string in an Application variable. The overhead of calling server.mappath, while minimal, is unnecessary each time you create a database connection. Plus, its also another few lines of code the scripting engine has to process.<BR><BR>Again, not a major impact by any means but it is unnecessary...

Posting Permissions

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