Connection code between ASP and SQL database!
// Method 1:
Mm_conn_string = "driver = {SQL Server}; server = (local); uid = sa; Pwd =; database = infs ;"
Set conn = server. Createobject ("ADODB. Connection ")
Conn. Open mm_conn_string
Set rs = server. Createobject ("adobd. recordset ")
SQL = "select * from Table order by ID DESC"
Rs. Open SQL, Conn, 3, 3
// Method 2: (DSN connection)
Mm_conn_string = "DSN = BBS; uid = sa; Pwd = 12345"
Set conn = server. Createobject ("ADODB. Connection ")
Conn. Open mm_conn_string
Set rs = server. Createobject ("adobd. recordset ")
SQL = "select * from Table order by ID DESC"
Rs. Open SQL, Conn, 3, 3 // 3, 3 is to modify, delete, add switch!
// Method 3:
Mm_conn_string_own = "driver = {SQL}; server = (local); uid = sa; Pwd = 11111; database = infs ;"
Set conn = server. Createobject ("ADODB. Connection ")
Conn. Open mm_conn_string_own
// Method 4-this method is used in access
Strconn = "driver = Microsoft Access Driver (*. mdb); DBQ = "_
& Server. mappath ("ASP. mdb ")
Set conn = server. Createobject ("ADODB. Connection ")
Conn. Open strconn