I just want one Connection

Results 1 to 2 of 2

Thread: I just want one Connection

  1. #1
    splavik Guest

    Default I just want one Connection

    I have about 4 ASP pages, one displays all the records, one allows you to delete, one allows you to add, and another to Edit,<BR>Now in all those at the top i have the :<BR>&#062; Set oConn = Server.CreateObject("ADODB.Connection")<BR>&#062; sConn = "DRIVER={SQL Server};"<BR>&#062; sConn = sConn & "SERVER=" & sServerName & ";"<BR>&#062; sConn = sConn & "DATABASE=" & sDatabase & ";"<BR>&#062; sConn = sConn & "UID=" & sUid & ";"<BR>&#062; sConn = sConn & "PWD=" & sPassword & ";"<BR>&#062; oConn.Open sConn<BR>Is there a way to do this ONLY ONCE?? and for all my pages to <BR>use the ssame oConn object?<BR>Another thing.. Without the (sConn = "DRIVER={SQL Server};")<BR>my connection doesnt work, is this NORMAL?? i&#039ve seen examples without that piece of code.. Any help or comments would be appreciated.<BR><BR>Splavik<BR>

  2. #2
    Jimmy Wang Guest

    Default RE: I just want one Connection

    save your code and call it perhaps myoConn.asp. Then reference it by using &#060;!--#include file="myoConn.asp"--&#062;<BR><BR>Good Luck.<BR>Jimmy Wang<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