rs.Open "select * from CarMan where CarNo='" & TextCarNo(0).text & "'",cnncnn 指活动连接

解决方案 »

  1.   

    Public Function myRSVal(mysql As String, mycon As String, myrscol As Integer) As String
    On Error GoTo myrsvalERR
        Dim myRs As New ADODB.Recordset
        Dim oCon As New ADODB.Connection
        
        oCon.ConnectionString = mycon
        oCon.Open
        oCon.CommandTimeout = 600
        myRs.Open mysql, oCon, adOpenStatic
        If myRs.EOF = False Then
            myRSVal = TurnNull(myRs(myrscol))
        Else
            myRSVal = ""
        End If
        Set myRs = Nothing
        oCon.Close
        Exit Function
    myrsvalERR:
        On Error Resume Next
        myRSVal = ""
        'oCon.Close
        Set myRs = Nothing
        Set oCon = Nothing
        myRSVal = ""
    End Function
      

  2.   

    Public Function TurnNull(ByVal astr As Variant) As String
        If Not IsNull(astr) Then
           TurnNull = Trim(astr)
        Else
           TurnNull = ""
        End If
    End Function看不懂就别问了
      

  3.   

    请问怎么将一个在数据库中的长二进制图片文件放入imagbox中啊?真的很着急知道摆脱了啊!