sql在VB6中的书写格式?请告诉我,谢谢!(在线等待)

解决方案 »

  1.   

    strsql = "insert into lb(mc) values('" & Trim(Txtlb) & "')"
    Set rs = conn.Execute(strsql)
    'Set rs = NothingDim strkey As String
    rs.Open "select id from lb where mc='" & Trim(Txtlb) & "'", conn
      

  2.   

    dim rs as new ado.recordersetsql="select * from " & 表名 & " order by " & 字段
    rs.open sql,cnn,adOpenDynamic
    cnn为活动连接
    adOpenDynamic为打开方式
      

  3.   

    Dim adoCnn As New adodb.Connection
     Dim adoCmm As New adodb.Command
     Dim adoRec As New adodb.Recordset
     
     adoCnn.Open "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=D:\Program Files\Microsoft Visual Studio\VB98\NWIND.MDB;Persist Security Info=False" adoCmm.ActiveConnection = adoCnn
     adoCmm.CommandType = adCmdText
     adoCmm.CommandText = "select * from employees"
     Set adoRec = adoCmm.Execute
      

  4.   

    Dim strSQL As String
        Dim cnn As New ADODB.Connection
        Dim rst As New ADODB.Recordset
        Dim strTemp As String
        strTemp = App.Path & "\shlr.mdb"
        cnn.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;Persist Security Info=False;Data Source=" & strTemp & ";Jet OLEDB:Database Password="
        cnn.Open
        
        strSQL = "select * from ttt where month(dt)=4 and day(dt)=5 "
        strSQL = "select * from sysobjects"
        rst.Open strSQL, cnn, adOpenDynamic, adLockOptimistic
        while not rst.eof
            .........
            rst.movenext
        wend
        If rst.State = 1 Then rst.Close
        Set cnn = Nothing
        Set rst = Nothing