DSNless Connection Using a Variable

Results 1 to 2 of 2

Thread: DSNless Connection Using a Variable

  1. #1
    Join Date
    Dec 1969

    Default DSNless Connection Using a Variable

    I can successfully create a DSNless connection, but I would like to use a variable for the connection string so that I can move this ASP file from server to server without having to type in a new DB connection string each time. The variable (ConnString) looks properly, but the ConnectionString won&#039t read it has a proper string.<BR><BR>My ASP file looks like this:<BR><BR>&#060;%<BR><BR>DBpath = server.mappath("temps.mdb")<BR>DriverString = "DRIVER={Microsoft Access Driver (*.mdb)}"<BR>ConnString = (Chr(34)) & "DBQ=" & DBpath & ";" & DriverString & (Chr(34))<BR><BR>Dim objConnSet objConn = Server.CreateObject("ADODB.Connection")<BR>objConn .ConnectionString = ConnString<BR>objConn.Open<BR><BR>objConn.Close<BR >objConn = Nothing<BR><BR>%&#062;<BR>

  2. #2
    steveo Guest

    Default RE: DSNless Connection Using a Variable

    just make that exact sample of script an asp file and include in any page you want &#060;--! include file="xxxx.asp" --&#062;

Posting Permissions

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