Dim x As Integer
Dim y As Integer
Dim z As Integer
Adodc11.RecordSource = "select * from PROCESS where jczhuangtai=0"
Adodc11.Refresh
If IsNull(Adodc11.Recordset("number1")) Then
x = 0
Else
x = Adodc11.Recordset("number1")
End If
If IsNull(Adodc11.Recordset("number2")) Then
y = 0
Else
y = Adodc11.Recordset("number2")
End If
If IsNull(Adodc11.Recordset("number3")) Then
z = 0
Else
z = Adodc11.Recordset("number3")
End If
Dim con As New ADODB.Connection
con.Open ("Provider=SQLOLEDB.1;Integrated Security=SSPI;Persist Security Info=False;Initial Catalog=独占设备;Data Source=PC-20110915FGKA")
con.Execute "update DCT set zhuangtai=1 where 'dctbiaohao' in(select top x DCT.dctbiaohao from SDT,DCT where SDT.dctbiaohao=DCT.dctbiaohao and SDT.shebeiliexing='input'and DCT.zhuangtai=0)"
con.Execute "update DCT set zhuangtai=1 where 'dctbiaohao' in(select top y DCT.dctbiaohao from SDT,DCT where SDT.dctbiaohao=DCT.dctbiaohao and SDT.shebeiliexing='output'and zhuangtai=0)"
con.Execute "update DCT set zhuangtai=1 where 'dctbiaohao' in(select top z DCT.dctbiaohao from SDT,DCT where SDT.dctbiaohao=DCT.dctbiaohao and SDT.shebeiliexing='store' and zhuangtai=0)"
这里面的top x这个地方出错,可不可以实现?怎么实现?不能实现如何更改?