ASP MSSQL Connection

While using asp my convention is to make a connection function inside asp block and to include it on all ASP Files

Sub OpenDatabase(ByRef dbConn)    Set dbConn = Server.CreateObject(“ADODB.Connection”) dbConn.ConnectionTimeout = 150 dbConn.CommandTimeout = 150 dbConn.Open “Provider=SQLOLEDB.1;Persist Security Info=False;User ID=username;Password=password;Initial Catalog=database name;Data Source=localhost”

end sub

savethis into SQLC.asp (SQL Connection)

and include in all asp pages like

<!–#include file=”sqlc.asp”–>

abhilash

abhilash, is a programmer by profession and a technology addict with a passion towards browsing , shopping and imaging . My views may be biased on reviews. all images and videos are copyrighted to respective owners.

1 comment

Your Header Sidebar area is currently empty. Hurry up and add some widgets.