Public Function getConn(sqlStr as String) As ADODB.Connection
Dim conn As New ADODB.Connection
Dim strCnn As String
getStrCnn ="dsn=yatl;database=yatl;uid=;pwd="
conn.open strCnn
getConn=conn
End Function为什么我写的不能运行呀?谢谢了
Dim conn As New ADODB.Connection
Dim strCnn As String
getStrCnn ="dsn=yatl;database=yatl;uid=;pwd="
conn.open strCnn
getConn=conn
End Function为什么我写的不能运行呀?谢谢了
2、
Public Function getConn(sqlStr as String) As ADODB.Connection
Dim conn As New ADODB.Connection
Dim strCnn As String
StrCnn ="provider=MSDASQL;dsn=yatl;database=yatl;uid=;pwd="
conn.open strCnn
getConn=conn
End Function
Dim conn As New ADODB.Connection
Dim strCnn As String
getStrCnn ="dsn=yatl;database=yatl;uid=;pwd="
conn.open strCnn
Set getConn=conn '----------------------------------------------
End Function