没有报错,怎么就是不能把数据录入到数据库呢
用vb写的录入查询系统不能录入,可能的问题有哪些?
谁有这方面的资料呀?
帮忙看看!
dim mrc As ADODB.Recordset
txtsql = "select 姓名 from expert where 姓名='" & Trim(Text3(0).Text) & "'"
Set mrc = ExecuteSQL(txtsql)
Dim i As Integer
Do Until mrc.EOF
MsgBox "该专家的档案已经存在!!"
Form1.Show
For i = 0 To 9
Form1.Text3(i).Text = Form1.Adodc1.Recordset.Fields(i)
Next
mrc.Close
Exit Sub
Loop
txtsql = "select * from expert"
Set mrc = ExecuteSQL(txtsql)
mrc.AddNew
For i = 0 To 9
mrc.Fields(i) = Trim(Text3(i).Text)
Next
MsgBox "添加成功!!"
For i = 0 To 9
Text3(i).Text = ""
Next
Text3(0).SetFocus