Connecting to Access DB

Results 1 to 2 of 2

Thread: Connecting to Access DB

  1. #1
    Join Date
    Dec 1969

    Default Connecting to Access DB

    Hi all,<BR>I am having the following code in my global.asa file. Now every time I try to open a ASP page after rebooting my system, I get the error saying DB not found. But I know the DB exists in the specified path and the application begins to work if I do either one of the following two steps<BR>1) Just Open and Save Global.asa without making any changes whatsoever. OR<BR>2) Remove the application name and create it again the Virtual Directory in IIS.<BR><BR>I am absolutely clueless as to what the problem is. Once the application starts working I have absolutely no problems how many ever times I close and open the browser. The problem repeats only when I restart my machine.<BR><BR>Sicne I am about to move the application to a real world web server, I would be really grateful for any assistance with this problem.<BR><BR>Regards<BR>Sri:)<BR><BR><BR>Sub Application_OnStart()<BR> Application.Contents("cnnTest")="Provider=Microsof t.Jet.OLEDB.4.0;Data Source=" & Server.MapPath("../db/xyz.mdb") & ";Persist Security Info=False"<BR>End Sub

  2. #2
    Join Date
    Dec 1969

    Default RE: Connecting to Access DB

    I would seriously consider NOT creating a connection to your database in an application object. This just doesn&#039;t scale well at all. Consider creating your connection in another asp page and just include this page in any pages that require a database connection.

Posting Permissions

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