作者kelvinkao (关心被扭曲为找碴)
看板Visual_Basic
标题Re: [VB6 ] 查询问题 Part2
时间Sat Jun 11 19:40:00 2005
这个form全部的程式码都po上来了>"<
真的不知道问题出在哪
请大大救救我吧 Q_Q
============================================================
出现的错误讯息是:
您要求变更资料表,由於会对索引、主索引键或关联产生重复的值,所以不会成功。
变更栏位的资料或变更那些包含着重复资料的栏位、移除索引或重新定义索引以允
许重复索引值,然後再试一次。
==============================================================
按除错出来的问题是:
RS.Filter = "收料单单号 Like '" & Text1.Text & "'"
=============================================================
Dim RS As ADODB.Recordset
Private Sub Command1_Click()
RS.AddNew
End Sub
Private Sub Command2_Click()
RS.Update
DataGrid1.Refresh
MsgBox "资料库更新完毕"
End Sub
Private Sub Command3_Click()
RS.Delete
End Sub
Private Sub Command5_Click()
FltStr = ""
If Text1.Text <> "" Then
RS.Filter = "收料单单号 Like '" & Text1.Text & "'"
End If
If RS.EOF Then
MsgBox "没找到资料"
Exit Sub
End If
Do Until RS.EOF
For I = 0 To RS.Fields.Count - 1
Tmp = Tmp & RS.Fields(I) & " "
Next
RS.MoveNext
Loop
End Sub
Private Sub Form_Load()
Set RS = Adodc1.Recordset
End Sub
--
※ 发信站: 批踢踢实业坊(ptt.cc)
◆ From: 59.121.186.31