对象不是源自动事件
我编了一段VB6的程序,通过VB 的添加数据窗体向导中的网格(数据表)ADO代码生成的。但出现"对象不是源自动事件"错误,到底是怎么回事, 谢谢! 样本程序如下: Dim WithEvents adoPrimaryRS As Recordset Private Sub Form_Load() Dim db As Connection Set db = New Connection db.CursorLocation = adUseClient db.Open "PROVIDER=MSDASQL;dsn=AAAA;uid=sa;pwd=testing;database=ooTEST;"
Set adoPrimaryRS = New Recordset adoPrimaryRS.Open "select empcode,c_name,pinyin,orgcode1,orgcode2,DateIn,Shift01,Shift02,Shift03,OT01,OT02,OT03,LV01,LV02,LV03,LV04 from ASIMCO_Input Order by empcode", db, adOpenStatic, adLockOptimistic
Set grdDataGrid.DataSource = adoPrimaryRS
mbDataChanged = False End Sub