Public nadorec1 As New ADODB.Recordset, nadocon1 As New ADODB.Connection dim txt1 as stringconstr1 = "PROVIDER=Microsoft.Jet.OLEDB.4.0;Data Source=" & App.Path & "\你的数据库.mdb;Persist Security info=false" nadorec1.Open "Select * from 数据表 order by 主键", nadocon1, adOpenKeyset, adLockOptimistic nadorec1.find "类别编码='" & txt1 & "'" if not nadorec1.eof then MsgBox "XX已存在,请重新操作!", vbInformation + vbOKOnly, "提示" Exit Sub end if
dim txt1 as stringconstr1 = "PROVIDER=Microsoft.Jet.OLEDB.4.0;Data Source=" & App.Path & "\你的数据库.mdb;Persist Security info=false"
nadorec1.Open "Select * from 数据表 order by 主键", nadocon1, adOpenKeyset, adLockOptimistic
nadorec1.find "类别编码='" & txt1 & "'"
if not nadorec1.eof then
MsgBox "XX已存在,请重新操作!", vbInformation + vbOKOnly, "提示"
Exit Sub
end if