connecting

  • Hi all of you,

    I am new SQL Server, I want to connect SQL Server with ASP language and I only want to connect one. As global.asa file,

    anybody can guide me using global.asa file for connecting SQL Server

    Thank in advance

  • I can give you the basics:

    Create a function in the Global.asa file to open the connection. Use the ADO connection object to do this.

    i.e.

    MyFunc

    dim cn

    set cn = Server.CreateObject("ADODB.connection")

    cn.connectionstring = "string"

    cn.open

    MyFunc = cn

    End Func

  • Don't connect in global.asa. Put the connection string there and then reference that on each page as Jon suggested.

    Steve Jones

    steve@dkranch.net

  • Is it bad to connection global.asa? If so, why? Thought it was only basd to store connection (or other object) in a session variable?

    Andy

Viewing 4 posts - 1 through 3 (of 3 total)

You must be logged in to reply to this topic. Login to reply