比如~~procedure TForm1.DBGrid1CellClick(Column: TColumn);
begin
if DBGrid1.SelectedField.DataType = ftString then
label1.Caption := 'String';
if DBGrid1.SelectedField.DataType = ftInteger then
label1.Caption := 'Integer';
end;
begin
if DBGrid1.SelectedField.DataType = ftString then
label1.Caption := 'String';
if DBGrid1.SelectedField.DataType = ftInteger then
label1.Caption := 'Integer';
end;
解决方案 »
- 对webBrowser返回状态的问题
- 各位老大,请问 cxgrid 的 DBTableView 如何在没有数据的情况下也能画出表格来啊?在线~~~~~
- delphi---checkbox+数据库的显示问题
- 该过程能否优化
- 高分相求B/S型MIS系统(一个模块即可)Delphi源代码,分不够再加!
- 谁有DELPHI的关于网络拨号的源代码?高分相送!
- 求 Delphi的Tchart控件中的Bar如何使用
- 请问十进制数如何转成十六进制式的字符
- 求回车键变为TAB键函数
- 关于数据库的几个问题~
- 菜的不能再菜的问题:在''中再套一个''应如何写? 'he said:'i love you''
- 被同公司的女孩爱上了,干不了,怎么办 ????
Label1没有Text~~
还有人知道更好的方法吗??请指教!!
i:integer;
s:string;
begin
for i:=0 to tbl.FieldCount-1 do
begin
//memo1.lines.Add(tbl.Fields[i].ClassName);
case tbl.Fields[i].DataType of
ftUnknown: s:='ftUnknown';
ftString:s :='ftString';
end;
memo1.lines.Add(s);
{ ftSmallint, ftInteger, ftWord,
ftBoolean, ftFloat, ftCurrency, ftBCD, ftDate, ftTime, ftDateTime,
ftBytes, ftVarBytes, ftAutoInc, ftBlob, ftMemo, ftGraphic, ftFmtMemo,
ftParadoxOle, ftDBaseOle, ftTypedBinary, ftCursor, ftFixedChar, ftWideString,
ftLargeint, ftADT, ftArray, ftReference, ftDataSet, ftOraBlob, ftOraClob,
ftVariant, ftInterface, ftIDispatch, ftGuid
//以此类推
}
end;
end;
const
SLabel_Datatype: array [TFieldType] of string =
('ftSmallint', 'ftInteger', ...);//对应TFieldTypeS := SLabel_DataType[Field[I].DataType];
memo1.Lines.Add(S);