如何判断msflexgrid在数据绑定后的某一列是什么数据类型?

解决方案 »

  1.   

    取出值出判断.
    isnumber
    isdate
    ……
      

  2.   

    for i = grid.fixedcols to grid.cols-1
        if isnumeric(grid.textmatrix(grid.fixedrows,i)) then 
            msgbox "数字"
        elseif isdate(grid.textmatrix(grid.fixedrows,i)) then 
            msgbox "日期"
        else
            msgbox "字符"
        end if
    next
      

  3.   

    放到grid里面数据都被转换成字符型,要想判断什么类型
    看看绑定的rs相关类型
    MsgBox FieldType(rs("SomeDate").Type)Public Function FieldType(intType As Integer) As String   Select Case intType
          Case adChar
             FieldType = "adChar"
          Case adVarChar
             FieldType = "adVarChar"
          Case adSmallInt
             FieldType = "adSmallInt"
          Case adUnsignedTinyInt
             FieldType = "adUnsignedTinyInt"
          Case adDBTimeStamp
             FieldType = "adDBTimeStamp"
       End SelectEnd Function