ADODB.Connection的问题
如DLL
Public Sub ST (sCn As ADODB.Connection)
from1.show
end sub
程序怎么样传递SCN呢?
Dim Cn As ADODB.Connection
Private Sub Form_Load()
Set Cn = New Connection
StrCn = "Provider=SQLOLEDB.1;Password=lASD;Persist Security Info=True;User ID=sa;Initial Catalog=QSD;Data Source=ASDAS "
Cn.Mode = adModeReadWrite
Cn.CursorLocation = adUseClient
Cn.CommandTimeout = 1800
Cn.Open
End Sub
Private Sub Command1_Click()
Dim odj As pclass.Class1
Set odj = New Class1
odj.st (Cn)
End Sub
Cn对象怎么传入到DLL。在线等待
[解决办法]
什么问题?没反映?改一下吧:
Public Sub ST(sCn As ADODB.Connection)
dim f as new form1
f.Show
End Sub
Private Sub Command1_Click()
Dim odj As pclass.Class1
Set odj = New Class1
call odj.st (Cn)
End Sub