Foxtable(狐表)用户栏目专家坐堂 → [求助] Insert Into 返回ID


  共有236人关注过本帖树形打印复制链接

主题:[求助] Insert Into 返回ID

帅哥哟,离线,有人找我吗?
建筑人生
  1楼 | QQ | 信息 | 搜索 | 邮箱 | 主页 | UC


加好友 发短信
等级:小狐 帖子:341 积分:3422 威望:0 精华:0 注册:2014/8/20 20:14:00
[求助] Insert Into 返回ID  发帖心情 Post By:2024/4/20 16:17:00 [显示全部帖子]


Dim cmd As New SQLCommand
cmd.C
cmd.CommandText = "Insert Into HeTong (gcmc,gcdz,htdw,htbh,xmfzr,htgq,kssj,htxs,htje,fpsl,wcsj,dwmc,dwdz,dwxz,lxr,lxdh1,lxdh2,email,zw,wx,qq,khmc,khzh,khh,swdjh,jlr,jlsj,fj) values ('" & gcmc & "','" & gcdz & "','" & htdw & "','" & htbh & "','" & xmfzr & "','" & htgq & "',#" & kssj & "#,'" & htxs & "'," & htje & "," & fpsl & ",#" & wcsj & "#,'" & dwmc & "','" & dwdz & "','" & dwxz & "','" & lxr & "','" & lxdh1 & "','" & lxdh2 & "','" & email & "','" & zw & "','" & wx & "','" & qq & "','" & khmc & "','" & khzh & "','" & khh & "','" & swdjh & "','" & jlr & "',#" & jlsj & "#,'" & fj & "');Select SCOPE_IDENTITY()"



Dim id As Integer = cmd.ExecuteScalar()'新增行ID

MessageBox.Show(ID)


加了黄色位置,提示在 SQL 语句结尾之后找到字符。,是Access外部数据库

 回到顶部