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外部数据库