Conn Str in Global.asa

Results 1 to 4 of 4

Thread: Conn Str in Global.asa

  1. #1
    Tony Guest

    Default Conn Str in Global.asa

    Is there any reason why I couldn&#039;t/shouldn&#039;t store a connection string in the global.asa like so: <BR><BR>sub Application_OnStart() <BR> Application("dbConn_ConnectionString") = "my conn string..." <BR>end sub <BR><BR>There are times when my fails when using this Application Variable as the connection string. <BR><BR>Thank you for your help in advance, <BR><BR>Tony

  2. #2
    Join Date
    Dec 1969
    Los Angeles, CA

    Default No reason

    it SHOULD work fine<BR><BR>check for the value of the application variable on the page and see if it is right<BR><BR>what is the error you get when you open the connection

  3. #3
    Tony Guest

    Default variable is an empty string

    The Application variable is an empty string. So, the global.asa must not be initializing properly. <BR><BR>Here&#039;s the code I use in global.asa to set the value:<BR><BR>sub Application_OnStart()<BR> Application("dbConn_ConnectionString") = & _<BR> "Provider=Microsoft.Jet.OLEDB.4.0;" & _<BR> "Data Source=(drive):(dir)db.mdb;" & _<BR> "Persist Security Info=False"<BR>end sub<BR><BR>Thanks for your help

  4. #4
    Tony Guest

    Default figured it out

    Akhilesh, I figured it out.<BR><BR>For some reason, this Virtual Directory was not set up as an "Application" and therefore Application_OnStart was never firing. <BR><BR>Thank you for your help, <BR><BR>Tony

Posting Permissions

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