我试图将我的查询与之前的帖子相匹配,但无法解决我的问题。
我有一个表 user_master,我从其他表中导入 permission_id 和 zone_id 作为键。日期为短格式。
cmd.CommandText = "INSERT INTO user_master(uname, password, creation_date, creation_time, permission_id, zone_id)" & "VALUES('" & txtuname.Text & "','" & txtupass.Password & "','" & date_gl & "','" & time_gl & "','" & _user_perm & "','" & _zone_id & "')"
cmd.ExecuteNonQuery()
主键是autonumber,creation_date/time在其他查询中执行成功,permission_id和zone_id是数字。其他字段是文本。我通过更改此查询(删除引号等)尝试了几种排列和组合,字段计数也相同。请让我知道我执行错误的参数是什么?
情况也是如此,
cmd.CommandText = "UPDATE user_master SET uname = " & """" & txtuname.Text & """" & _
" and password = " & """" & txtupass.Password & """" & _
" and creation_date = " & """" & date_gl & """" & _
" and creation_time = " & """" & time_gl & """" & _
" and permission_id = " & _user_perm & _
" and zone_id = " & _zone_id & _
" WHERE ID = " & _usr_id_temp
cmd.ExecuteNonQuery()
我希望得到正确的帮助。
谢谢你,abhimoh