November 5, 2001 at 7:24 pm
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
November 5, 2001 at 7:30 pm
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
November 5, 2001 at 10:54 pm
Don't connect in global.asa. Put the connection string there and then reference that on each page as Jon suggested.
Steve Jones
November 6, 2001 at 5:25 am
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