我用insert语句向oracle表中插入一组数据,有数字的也有汉字的变量。其中汉字变量可以插入到表中,在程序中可以用datagrid看到,可是用oracle自带的sql查询却查不到,不知道问什么,应该没有多余的空格!!
急!!!!!!!!!!!!!

解决方案 »

  1.   

    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行。