<%
Dim DBUserID,DBPassWord,DBName,DBIP,Conn,StrConn
DBUserID="*******" '数据库登陆名
DBPassWord="******" '数据库密码
DBName="******" '数据库名称
DBIP="localhost"
' ID 自动编号字段类型 int 标识“是” 标识种子“1”、标识递增量“1”
Set Conn=Server.CreateObject("Adodb.Connection")
Connstr = "PROVIDER=SQLOLEDB.1;Data Source="&DBIP&";Initial Catalog="&DBName&";Persist Security Info=True;User ID="&DBUserID&";Password="&DBPassWord&";Connect Timeout=60"
if err then
err.clear
else
conn.open connstr
end if
sub CloseConn()
conn.close
set conn=nothing
end sub
%>0daybank
文章评论