<%
Response.Buffer=True
Response.ExpiresAbsolute=Now()-1
Response.Expires=0
Response.CacheControl = "no-cache"
Response.AddHeader "Pragma", "No-Cache"
Server.ScriptTimeout=90
On Error Resume Next
address="127.0.0.1" '服务器地址
data="vibcne" '数据库名
name="admin" '用户名
pass="baidu123" '密码
connstr="Driver={SQL Server};SERVER="+address+";DATABASE="+data+";UID="+name+";PWD="+pass+""
Set conn = Server.CreateObject("ADODB.Connection")
conn.Open connstr
If Err Then
err.Clear
Set Conn = Nothing
Response.Write "
数据库连接出错!
"Response.Write "
可能出错原因:数据库位置或名称不对、数据库损坏!
"Response.End
End If
%>