注册 登录
编程论坛 VB6论坛

添加新记录时显示数据错误

rogersgb 发布于 2016-02-05 08:24, 1459 次点击
strSql = "Insert Into [vpdn](name,username,password,WSSBYHM,WSSBMM) Values(Text1.Text,Text2.Text,Text3.Text,Text4.Text,Text5.Text)"
conn.Execute strSql
这句话运行时,显示insert into语法语句错误,求解,添加数据中ID是自动编号的
1 回复
#2
风吹过b2016-02-05 16:44

你把 你的 SQL 命令显示出来就知道什么地方错了。
strSql = "Insert Into [vpdn](name,username,password,WSSBYHM,WSSBMM) Values(Text1.Text,Text2.Text,Text3.Text,Text4.Text,Text5.Text)"

----------------
Text1.Text,Text2.Text,Text3.Text,Text4.Text,Text5.Text
全放在 引号之前,是直接使用这个字符串,而不是取这几个控件的值。
学习一下字符串连接方面的内容。

1