我在寫client/server 運用了active.exe 但我不是很會寫???
執行時會出現沒有設定物件變數或with區塊變數
程式如下:
(寫在server物件模組中)


Private cn As Connection
Private rs As Recordset


Public Sub Main()
Set cn = New Connection
cn.ConnectionString = = "dsn=miss"
cn.Open
Set rs = New Recordset
rs.Open "studtable", cn, adOpenStatic, adLockOptimistic
End Sub


Public Property Get ttt() As Variant
ttt = rs
End Property
(clinet)
Dim a As myserver31.kk1
Private Sub Form_Load()
Set a = New myserver31.kk1
Set DataGrid1.DataSource = a.ttt
End Sub


Private Sub Form_Unload(Cancel As Integer)
Set a = Nothing
End Sub

創作者介紹
創作者 vbqa 的頭像
vbqa

小吳 VBQA 程式設計討論

vbqa 發表在 痞客邦 留言(1) 人氣()