运行时错误3704
|
在我的vb6中,关闭对象时,我收到错误3704的操作不允许。
我在搜索stackoverflow中遇到了类似的问题,但是我想缺少一些东西。我需要根据记录集rs1更新vfp中的每一行,这是我的代码:
Option Explicit
Dim cn As New ADODB.Connection
Dim cn1 As New ADODB.Connection
Private Sub trns_Click()
Set cn = New ADODB.Connection
Set cn1 = New ADODB.Connection
cn.ConnectionString = MDI1.txtcn.Text
cn.Open
cn1.ConnectionString = \"Provider=VFPOLEDB;Data Source=\\\\host1\\software\\MIL\\company0\"
cn1.Open
rs1.Open \"Select * from trans\", cn, adOpenStatic, adLockPessimistic
Do While Not rs2.EOF
rs2.Open \"update transac set no_ot_1_5 = \" & rs1.Fields(\"ovt1\") & \", no_ot_2_0 = \" & rs1.Fields(\"ovt2\") & \", no_ot_3_0\" _
& \"= \" & rs1.Fields(\"ovt3\") & \",Meal_allw = \" & rs1.Fields(\"meal_allow\") & \",on_duty = \" & rs1.Fields(\"cnt\") & \",no_d_local = \" & rs1.Fields(\"local\") & \",no_d_sick\" _
& \"= \" & rs1.Fields(\"sick\") & \",no_d_abs = \" & rs1.Fields(\"absence\") & \",no_d_spc = \" & rs1.Fields(\"special\") & \",Revenue02\" _
& \"= \" & rs1.Fields(\"refund\") & \",Revenue05 = \" & rs1.Fields(\"prepay\") & \",Deduct05 = \" & rs1.Fields(\"prepay\") & \",Revenue01 = \" & rs1.Fields(\"comm\") & \"where code = \'\" & rs1.Fields(\"emp_code\") & \"\' and transac.date = CTOD(\'\" & trans.txtend2 & \"\')\", cn1, adOpenDynamic, adLockPessimistic
If Not rs2.EOF Then
rs2.MoveNext
End If
Loop
rs2.close
没有找到相关结果
已邀请:
4 个回复
苦诫
泪琉踞檄
席陋临拈
悲帽慑彤电