n00b - ZMSQL - How do I initially create tables? lazarus / 16-Databases ---------------------------------------------------------------------- Knipfty · 2012-04-23 09:40 Hi All, It's been a little more than a decade since I've used Delphi and am trying to do a small project for a friend.  I've downloaded and installed Lazarus and ZMSQL as well.  I've got the shell of the program up.  I'm now trying to code the 1st table of the database called Lenders.txt. 1. Do I need to create the table by handle using something like notepad++?  Which means typing in the field names on the 1st line and perhaps filling in a second line with some data?  Or will ZMSQL create this table for me? 2. How do I read this table into ZMQueryDateSet object?  When I specify the table name I get errors. 3. Assuming that I actually get data showing up in a dbgrid object, what steps to I need to take to edit or insert data and post them back out to the table on disk? Thanks in advance, Scott PS based on the time I spent using these tools this past weekend, I'm very much impressed.  It feels very much like I remember Delphi feeling.  Good job everyone! ---------------------------------------------------------------------- marsheng · 2012-04-23 10:40 I'm also new so here is my take. (Also from Delphi 6) I'm using MySQL Drop and SQLconnection, SQLtransaction, SQLquery and DataSource onto you form or better still datamodule. In the SQLConnection - you set the parameters to connect to your db. The db must be running as in the case of MySql The SQLtransaction then connects to SQLConnection From here, the SQLquery creates the table/data you require using the SQLTransaction. You need to specify an SQL statement in the Query to fetch your data.   My statement is SELECT * FROM members where members is a table in the DB. The DS then connects the query results with your DBGrid or other forms. Here is a video to get you started. http://www.youtube.com/watch?v=pq2oCiJePHo Took me a while but really pleased with the result. You will have to learn some SQL language. I use XAMPP to start and stop my SQL database and Heidi to edit the DB. ---------------------------------------------------------------------- tatamata · 2012-05-05 10:23 Use FieldDefs property of Object inspector to define fields (columns). Use either Open method (in case of a table) either QueryExecute method (in case of queries) to create dataset. ---------------------------------------------------------------------- tatamata · 2012-05-05 10:25 You can also create Csv table in a spreadsheet or a text editor and load it into zmsql by LoadFromCsv method. ---------------------------------------------------------------------- tatamata · 2012-05-08 18:37 Quote from: yurosie on May 08, 2012, 07:23:36 pmQuote from: tatamata on May 05, 2012, 12:25:36 pmYou can also create Csv table in a spreadsheet or a text editor and load it into zmsql by LoadFromCsv method. I think this is the easiest way .. The easiest yes, but the least flexible, because in that case zmsql will create fielddefs on the fly as string fields. It would be better to define fieldefs first, to have proper data types.