TDBF List all Tables in a directory lazarus / 16-Databases ---------------------------------------------------------------------- anis2505 · 2013-08-08 10:04 Hi all, I'm working on a project that needs to provide a dbf table directory It should lists all the tables in that directory in a DBGRID to let the user choose the table to work with. Never used TDBF before all suggestion are welcome. regards ---------------------------------------------------------------------- howardpc · 2013-08-08 10:35 Since with xbase files (dbase, and Lazarus TDBF implementation) the 'database' is the table (i. e. the .dbf file), it is sufficient to use a TOpenDialog with a '*.dbf' filter to let the user choose a table to open (if such raw user access to the data is acceptable). Hardly recommended, but certainly possible. ---------------------------------------------------------------------- anis2505 · 2013-08-08 10:44 Hi, Thanks for reply. such solution would be very annoying. What I have in mind is listing all table on a DBGrid and let the user select the table to work with. Also I need the table list for other tasks. I have done the same job with OleDB using C# and Visual Studio 2010 and I wanted to rewrite it in Lazarus/FPC. regards ---------------------------------------------------------------------- taazz · 2013-08-08 11:04 There is no server in tdbf where you can select the tables in the database. You can fake it by letting the user or your program select the folder with the .dbf files and the you collect them and show them in a grid. DBGrid is a pain in the behind for this specific use forget it and go for findfirst findnext or some other kind of file searching procedure to do it. If you still want in to dbgrid then use a TBufDataset and populate it manually from the directory where your tables will be placed. ---------------------------------------------------------------------- BigChimp · 2013-08-08 12:08 What taazz said. Putting the dbfs you found with findfirst...findnext in a stringgrid should work just fine. If you hit any other problems with tdbf, be sure to post - I'd be happy to fix bugs in the FPC trunk implementation. ---------------------------------------------------------------------- anis2505 · 2013-08-08 13:17 Thanks all for reply Sorry but could anyone provide me with  a good TDBF tutorial I can't find a good one on the net. Thanks in advance regards ---------------------------------------------------------------------- BigChimp · 2013-08-08 13:42 I know of only one tdbf tutorial - the tdbf tutorial on the wiki. Included on that page is a link to the TDBF documentation.