求一SQL语句
程序代码:
请教一个问题啊!!我搞了好长时间了!! Private Sub Command1_Click() Dim con As New ADODB.Connection Dim rs As New ADODB.Recordset con.Open "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & App.Path & "\db\tybm.mdb;Persist Security Info=False" rs.CursorLocation = adUseClient rs.Open ("select * from tyks order by cdbl(kh)"), con, adOpenDynamic, adLockBatchOptimistic ①con.Execute ("UPDATE tyks SET df = dMAX('cj1','pfb','tycj8 <=' & tyks.cj &'and xbdm='' & tyks.xb&''') Where bkdm = '8'") ②con.Execute ("UPDATE tyks SET df = (select max(cj1) from pfb where tycj8 <=tyks.cj and xbdm= tyks.xb) Where bkdm = '8'") Set DataGrid1.DataSource = rs End Sub 用第一句,提示DMAX没有定义, 用第二句,操作必须使用一个可更新的查询 如何更改,才能实现上述功能![表情]