向ACCESS里面添加数据(有代码)
请教各位,向数据库HYDATA里面的ADMIN表添加窗体上文本框里面的内容。这里应该怎么写呢?谢谢了! Private Sub cmdSave_Click()
'必填项不能为空!!
If User.Text = "" Or Sex.Text = "" Or Station.Text = "" Or Pwd.Text = "" Or RePwd.Text = "" Or Nation.Text = "" Or MoveMobile.Text = "" Or HomePhone.Text = "" Or HomeAddress.Text = "" Then
MsgBox "有必填项目没有填写,请返回重新输入!", vbExclamation + vbOKOnly, "提醒!"
User.SetFocus
'判断密码不能空和两次密码不一致!
ElseIf Pwd.Text <> RePwd.Text Then
MsgBox "两次密码输入不一致,请返回重新输入!", vbExclamation + vbOKOnly, "提醒!"
User.SetFocus
Else
Dim Conn As New ADODB.Connection
Dim StrSql As String
Conn.Open "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & App.Path & "\Data\Hydata.mdb" & ";Mode=ReadWrite;Persist Security Info=False"
'向数据库HYDATA里面的ADMIN表添加窗体上文本框里面的内容。这里应该怎么写呢?
'谢谢了
Conn.Close
End If
End Sub