求助 向Access写入数据
Private Sub cmdOK_Click()
Dim I As Integer, SJ As Boolean
Dim mySQL As String, YHBH As String
If Text1 = "" Then Exit Sub
mySQL = "Select 编号 From tblUsers Order by [编号] Desc;"
YHBH = Format(RstMax(mySQL), "000")
mySQL = "Select * From tblUsers"
RST.Open mySQL, Con, adOpenKeyset, adLockBatchOptimistic
RST.AddNew
RST.Fields("编号").Value = YHBH
RST.Fields("用户名").Value = Text1.Text
RST.Fields("密码").Value = CStr(PWord(Text3.Text))
RST.Fields("照片").Value = Text5.Text
RST.Fields("真实姓名").Value = Combo1.Text
RST.Fields("员工编号").Value = Text2.Text
RST.Fields("系统权限").Value = "user"
RST.Update
RST.Close
End Sub
代码执行无错误报告,但没有效果,即数据库中没有成功添加数据。是哪儿错了?该如何写才能向Access添加数据?
怎么上传附件?
[ 本帖最后由 tchw131 于 2011-5-20 01:29 编辑 ]