Dbase connection

Results 1 to 2 of 2

Thread: Dbase connection

  1. #1
    SteveW Guest

    Default Dbase connection

    I&#039;m using a DSN connection, and I can connect fine when I build the connection script when I need it on the page...<BR><BR> Dim objConn<BR> Set objConn = Server.CreateObject("ADODB.Connection")<BR> objConn.Open "nt2189-ProfileWeb"<BR><BR>However, I am trying to put build a variable to hold this connection in my global.asa When I do that I get the error<BR><BR>Could not find file &#039;C:WINNTsystem32
    t2189-ProfileWeb&#039;. <BR><BR>So there is something wrong in this line in my global.asa...<BR><BR>Application ("cnString") = "Provider=Microsoft.Jet.OLEDB.4.0; Data Source=nt2189-ProfileWeb; Persist Security Info=False" <BR><BR>Any ideas?<BR>

  2. #2
    Join Date
    Dec 1969

    Default RE: Dbase connection

    I think the 2 things you are doing are essentially different.<BR>Depends on whether you want to connect through a System DSN or not<BR><BR>objConn.Open "nt2189-ProfileWeb"<BR>is looking for a System DSN which defines what the data source is. However your other connection string is DSN-less, it explcitly states the provider etc. and the Data Source is expected to be the location of the actual database file on the server<BR><BR>if you want to use the second method as shown then it needs to be something like<BR><BR>Application ("cnString") = "Provider=Microsoft.Jet.OLEDB.4.0; Data Source=c:inetpubdbrootmyDB.mdb; Persist Security Info=False" <BR><BR>hope that helps<BR><BR><BR><BR><BR><BR>

Posting Permissions

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