标签:
Function connMMSQL(ip,user,pwd,database,strsql) Dim conn,Re,arr(2) set conn = CreateObject("ADODB.Connection") conn.ConnectionString="Provider=SQLOLEDB.1;Password="+pwd+";Persist Security Info=True;User ID="+user+";Initial Catalog="+database+";Data source="+ip conn.Open If conn.state=0 Then arr(0) = -1 connMMSQL = arr ElseIf conn.state=1 Then set Re = conn.execute(strSql) If Re.EOF = False Then arr(0) = 1 arr(1) = Re.GetRows connMMSQL = arr ElseIf Re.EOF = True Then arr(0) = 0 connMMSQL = arr End If End If conn.close Set conn = Nothing End Function
标签:
原文地址:http://www.cnblogs.com/Tester-ABX/p/4501101.html