关于用程序插入数据,用SQL查询的问题
rkstr = "insert into RKLS values ('" & UCase(Text1.Text) & "','" & Trim(Text2.Text) & " '," & Text3.Text & " , " & Text4.Text & " ,'" & Text5.Text & "','" & datestr & "'," & Text3.Text & "*" & Text4.Text & ")"End If
ypconn.BeginTrans '执行插入数据命令
Dim rkcmd As New ADODB.Command
Set rkcmd.ActiveConnection = ypconn
rkcmd.CommandText = rkstr
rkcmd.Execute
ypconn.CommitTrans '提交命令
其中text2.text是名称
在SQL中查询时:
SQL> select * from rkls;
编号 名称 单价 数量 规格 日期
-------------------- -------------------- --------- --------- -------------------- ----------
合计
---------
44 电话 50 100 步步高 2009.04.14
5000
SQL> select * from rkls where 名称='电话';
未选定行
--------------------编程问答--------------------
rkstr = "insert into RKLS values ('" & UCase(Text1.Text) & "','" & Trim(Text2.Text) & " '," & Text3.Text & " , " & Text4.Text & " ,'" & Text5.Text & "','" & datestr & "'," & Text3.Text & "*" & Text4.Text & ")"
End If
ypconn.BeginTrans '执行插入数据命令
ypconn.execute rkstr
ypconn.CommitTrans '提交命令
--------------------编程问答-------------------- 不明白
补充:VB , 数据库(包含打印,安装,报表)