Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories

making a common connection information file

hi all,
i tried to have the connection settings and initialization into one .asp file instead of rewriting the connection string eachtime, but when i included it in my asp pages using
[code]

connection.open(odbc);
[/code]
an error was reported something like undefined variable connection, although inside the cinf.asp:
<% var connection=Server.CreateObject("ADODB.Connection")
//continue initializing...
%>
can someone help me with this coz i am really stuck,
10xxxxxxxx

Comments

  • weirdmixweirdmix Member Posts: 27
    you might want to declare the var connection in the main asp page using Dim, then the include page can create the object using that name.
    Hope this helps..

    : hi all,
    : i tried to have the connection settings and initialization into one .asp file instead of rewriting the connection string eachtime, but when i included it in my asp pages using
    : [code]
    :
    : connection.open(odbc);
    : [/code]
    : an error was reported something like undefined variable connection, although inside the cinf.asp:
    : <% var connection=Server.CreateObject("ADODB.Connection")
    : //continue initializing...
    : %>
    : can someone help me with this coz i am really stuck,
    : 10xxxxxxxx
    :

  • x_rayx_ray Member Posts: 71
    : you might want to declare the var connection in the main asp page using Dim, then the include page can create the object using that name.
    : Hope this helps..

    i will try it weirdmix, thanks for the idea.
    :
    : : hi all,
    : : i tried to have the connection settings and initialization into one .asp file instead of rewriting the connection string eachtime, but when i included it in my asp pages using
    : : [code]
    : :
    : : connection.open(odbc);
    : : [/code]
    : : an error was reported something like undefined variable connection, although inside the cinf.asp:
    : : <% var connection=Server.CreateObject("ADODB.Connection")
    : : //continue initializing...
    : : %>
    : : can someone help me with this coz i am really stuck,
    : : 10xxxxxxxx
    : :
    :
    :

Sign In or Register to comment.