Function conn() As Boolean
Dim adoconn As adocb.Connection
Set adoconn = New ADODB.Connection
t1 = GetFromIni("database", "server", ".\\thjl.ini")
Debug.Print t1
t2 = GetFromIni("database", "user", ".\\thjl.ini")
t3 = GetFromIni("database", "password", ".\\thjl.ini")
t4 = GetFromIni("database", "data", ".\\thjl.ini")
constr = "Provider=SQLOLEDB.1;Persist Security Info=True;Initial Catalog=" & t4 & ";Data Source=" & t1 & ""
adoconn.ConnectionString = constr
adoconn.CursorLocation = adUseClient
adoconn.Open constr, t2, t3
End Function
我定义的函数,VB连接sql,我定义的是不是有问题,该怎么调用呢
杨魅力
相关分类