数据库连接问题
这是我数据库连接函数public Sub conn(sername,uid,pwd,database)
dim MM_conn_STRING_own,conn
MM_conn_STRING_own = "Provider=SQLOLEDB;server=("&sername&");uid="&uid&";pwd="&pwd&";database="&database&";"
On error Resume next
Set conn = Server.Createobject("ADODB.Connection")
conn.open MM_conn_STRING_own
If conn.errors.count = 0 Then response.write("连接数据库"&sername&"成功")
Else response.write("连接数据库"&sername&"失败")
End if
End Sub
这是调用conn函数的页面
<!--#include file="conn.asp"-->
<%
'航北段数据流入科怡接口
dim server1,uid,pwd,database
server1="local"
uid="sa"
pwd="123456"
database="ACT2"
conn sername,uid,pwd,database
%>
编译时出错
Microsoft VBScript 编译器错误 (0x800A03F6)
缺少 'End'
/interface/conn.asp, line 10
Else response.write("连接数据库"&sername&"失败")