利用adodc来绑定ACCESS数据库,用nshflexgrid来显示其内容,access数据库的每个字段内容为两个数字组成的完整的单个数。
如format(string,"00")
我要得到01,02,03,04,05,06,07,08,09,10,11 这样的格式数字, 该怎么做呢

解决方案 »

  1.   

    SELECT format(it1,'00') from t1
      

  2.   

    Private Function fun_get_location(ByVal intCol As Integer, ByVal intStart As Integer, ByVal intEnd As Integer) As Integer
        Dim i As Integer
        Dim strTemp As String
        Dim blnRun  As Boolean
        Dim intBegin As Integer
        Dim intFind As Integer
        
        For i = intStart \ 2 + 1 To intEnd
            strTemp = strTemp & MSFlexGrid1.TextMatrix(i, intCol)
        Next i
        
        intBegin = 1
        blnRun = True
        
        While blnRun
            intFind = InStr(intBegin, strTemp, Text1.Text)
            
            If intFind > 0 Then
                If intFind Mod 2 = 1 Then
                    intBegin = intFind + Len(Text1.Text)
                Else
                    blnRun = False
                End If
            Else
                blnRun = False
            End If
        Wend
        
        If intFind > 0 Then
            fun_get_location = intStart + intFind + Len(Text1.Text) - 1
        Else
            fun_get_location = 0
        End IfEnd Function
      

  3.   

    反了
    Private Function fun_get_location(ByVal intCol As Integer, ByVal intStart As Integer, ByVal intEnd As Integer) As Integer
        Dim i As Integer
        Dim strTemp As String
        Dim blnRun  As Boolean
        Dim intBegin As Integer
        Dim intFind As Integer
        
        For i = intStart \ 2 + 1 To intEnd
            strTemp = strTemp & MSFlexGrid1.TextMatrix(i, intCol)
        Next i
        
        intBegin = 1
        blnRun = True
        
        While blnRun
            intFind = InStr(intBegin, strTemp, Text1.Text)
            
            If intFind > 0 Then
                If intFind Mod 2 = 0 Then
                    intBegin = intFind + Len(Text1.Text)
                Else
                    blnRun = False
                End If
            Else
                blnRun = False
            End If
        Wend
        
        If intFind > 0 Then
            fun_get_location = intStart + intFind + Len(Text1.Text) - 1
        Else
            fun_get_location = 0
        End IfEnd Function