ASP Database Connection Program

Source: Internet
Author: User


<%@ LANGUAGE = VBScript CodePage = 936%>
<!--#include file= "safe.asp"-->
<%

On Error Resume Next
Response.Buffer = True
Dim startime
Dim conn
Dim connstr
Dim Sqldatabase,sql_pass_word,sql_user_id,sql_data_source
Startime=timer ()
Set conn = Server.CreateObject ("ADODB. Connection ")
ConnStr = "Provider=SQLOLEDB.1; Password= ' 88888547&* ($ '; Persist Security Info=false; User id= ' 888 '; Initial catalog= ' 888 ';D ATA source= ' 888 ' "
Conn. Open ConnStr
' ConnStr = ' provider=sqloledb.1;integrated security=sspi; Persist Security Info=false;data source= (local)
' Conn. Open ConnStr
' Conn. DefaultDatabase = "Dgjob"
Sub Creaters (SQL,LV1,LV2)
Set Rs=server. CreateObject ("Adodb.recordset")
Rs.Open Sql,conn,lv1,lv2
End Sub

function Closedb
Conn.close
Set conn = Nothing
End Function

If ERR Then
Response.Write "<!--" & Err.Number & ": & Err.Description &"--> "& vbCrLf
Response.Write "<!--" & Conn. ConnectionString & "-->" & vbCrLf
Response.Write "Database connection error, please check the connection string. "' Note, you need to translate these words into English.
Err. Clear
Set Conn = Nothing
Response.End
End If

function Rsclose
Set rs=nothing
End Function

function Connclose
Conn.close
Set conn=nothing
End Function

%>

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.