请教高手指点 VB+sql的问题
Private Sub cmdAdd_Click()Call getcboDepId
Call getcboEmpId '获取EmpId
'检验此用户名是否已经存在
txtTest = "select * from tbWorkRecord where RecordYear ='" + Trim(Combo1.Text) + "' and "
txtTest = txtTest + "RecordMonth = '" + Trim(Combo2.Text) + "' and EmpId='" + strEmpId + "'"
If DBExist(txtTest) <> 0 Then
MsgBox "信息已经存在,请重新输入!", vbOKOnly + vbExclamation, "警告"
Else
txtSQL = "insert into tbWorkRecord(RecordYear,RecordMonth,EmpId,DepId,DaysPreiMonth,"
txtSQL = txtSQL + "LeaveDays, AbsentDays, VacDays, ErrandDays,"
txtSQL = txtSQL + "LateDays, LeaveEarlyDays, Ot1Days, Ot2Days, Ot3Days)"
txtSQL = txtSQL + "values('" + Trim(Combo1.Text) + "','" + Trim(Combo2.Text)
txtSQL = txtSQL + "','" + strEmpId + "','" + strDepId + "','" + Trim(quanqinday.Text)
txtSQL = txtSQL + "','" + Trim(qingjiaday.Text) + "','" + Trim(kuanggongday.Text) + "','" + Trim(xiujiaday.Text)
txtSQL = txtSQL + "','" + Trim(chuchaiday.Text) + "','" + Trim(chidaoday.Text) + "','" + Trim(zaotuiday.Text)
txtSQL = txtSQL + "','" + Trim(dayday.Text) + "','" + Trim(wendday.Text) + "','" + Trim(holidayday.Text) + "')"
result = ExecuteSQL(txtSQL, rsttbWorkRecord, True)
MsgBox "添加成功!", vbOKOnly + vbExclamation, "警告"
Call viewDataRecord '刷新表格中的数据
Text1.Text = Combo3.Text
End If
End Sub
为什么提示添加成 数据库里却没有数据呢