procedure TForm1.FormCreate(Sender: TObject); begin SQLite3Connection1.Connected:=false; SQLite3Connection1.DatabaseName:='D:\lazarus\project2\testRUN.db'; //运行时的 数据库 SQLite3Connection1.Connected:=true; SQLQuery1.Active:=true; //SQLite3Connection1.GetTableNames(ListBox1.Items,false);//所有表名 SQLite3Connection1.GetFieldNames('userinfo',ListBox1.Items); //表结构,所有列 end;
列类型
uses typinfo; procedure TForm1.FormCreate(Sender: TObject); var DataType: TFieldType; begin DataType:=SQLQuery1.Fields[2].DataType; ShowMessage(GetEnumName(TypeInfo(TFieldType), Ord(DataType))); end;
所有列类型