以文本方式查看主题

-  Foxtable(狐表)  (http://foxtable.com/bbs/index.asp)
--  专家坐堂  (http://foxtable.com/bbs/list.asp?boardid=2)
----  [求助]關於列類型  (http://foxtable.com/bbs/dispbbs.asp?boardid=2&id=85607)

--  作者:JoyGum
--  发布时间:2016/5/30 10:47:00
--  [求助]關於列類型
請問有代碼可以"精確"的知道列是甚麼類型的嗎
例如IsString除了知道它字符型,能知道備註型嗎,或是能知道字符型的長度嗎?
例如IsNumeric能否知道它是整數型,還是雙精度小數? 
[此贴子已经被作者于2016/5/30 10:47:27编辑过]

--  作者:大红袍
--  发布时间:2016/5/30 10:57:00
--  

参考

 

For Each t As Table In Tables
    output.show(t.name)
    For Each c As Col In t.cols
        output.show(c.name & " " & c.Caption & " " & c.DataCol.DataType.name & " " & c.DataCol.MaxLength & " " & c.DataCol.Expression)
    Next
Next

--  作者:大红袍
--  发布时间:2016/5/30 10:58:00
--  

For Each dt As DataTable In DataTables
    For Each dc As DataCol In dt.DataCols
        output.show(dt.name & " " & dc.Name & " " & dc.Caption & " " & dc.datatype.Name & dc.MaxLength)
    Next
Next

 


--  作者:JoyGum
--  发布时间:2016/5/30 10:59:00
--  
感謝大紅袍