rkstr = "insert into RKLS values ('" & UCase(Text1.Text) & "','" & Text2.Text & " ','" & Text3.Text & " ', " & Text4.Text & " ,'" & datestr & "','" & Text5.Text & "')" ypconn.BeginTrans '执行插入数据命令 Dim rkcmd As New ADODB.Command Set rkcmd.ActiveConnection = ypconn rkcmd.CommandText = rkstr rkcmd.Execute ypconn.CommitTrans '提交命令sjklj ("select * from RKLS where sl<>0 order by bh asc,rq asc") '显示中显示RKLS 的信息 If Not rkset.EOF Then ' Set DataGrid2.DataSource = rkset DataGrid2.Refresh End If 其中text2.text处是汉字,可以插入到表中,在fatagrid2中可以看到。但在sql 中执行select * from RKLS where 名称='钢笔';却显示0行。
ypconn.BeginTrans '执行插入数据命令
Dim rkcmd As New ADODB.Command
Set rkcmd.ActiveConnection = ypconn
rkcmd.CommandText = rkstr
rkcmd.Execute
ypconn.CommitTrans '提交命令sjklj ("select * from RKLS where sl<>0 order by bh asc,rq asc") '显示中显示RKLS 的信息
If Not rkset.EOF Then '
Set DataGrid2.DataSource = rkset
DataGrid2.Refresh
End If
其中text2.text处是汉字,可以插入到表中,在fatagrid2中可以看到。但在sql 中执行select * from RKLS where 名称='钢笔';却显示0行。