1/10/2024 0 Comments Free pascal asm dbThen, change the Database property of SQLQuery1 to 'DBConnection'. This causes the Database property of SQLTransaction1 to automatically change to 'DBConnection'. A very simple way is to use the object inspector, but you can also do this in your source code.Ĭhange the Transaction property of DBConnection to 'SQLTransaction1'. You can enlarge the TDBGrid to have enough space to display all data. Now we have all database components needed for the first example. To connect this component to the database components we need a TDataSource component from the ' Data Access tab'. To display the data, we use a TDBGrid component, which can be found on the 'Data Controls' tab. The other two components, TSQLTransaction and TSQLQuery, can be used for all databases that are supported by SQLdb. MainframeDBConnection) so you know what it stands for. It's also generally a good idea to name your components for something useful in your program (e.g. This will simplify the rest of the tutorial when using different databases. Databases for that.Ĭlick on the TIBConnection (or equivalent connection component) on your form, and in the Object Inspector, change the name to DBConnection. Discussion of setting up any database access libraries is out of scope for this tutorial see e.g. a TSQLite3Connection' for an SQLite database, TPQConnection for a PostgreSQL database. If you are using a different database, substitute the proper component from the ' SQLdb tab, e.g. TIBConnection is an Interbase/Firebird specific connection component. To get access to our database we need one TIBConnection, one TSQLTransaction and one TSQLQuery component from the ' SQLdb tab' in the component palette: Please see SQLdb_Tutorial0, which will walk you through making sure you have the right sample database set up.įirst you should create a new Lazarus project. This tutorial is written for use with recent Lazarus versions (Laz 1.0) it should also work on older versions Lazarus 0.9.30. Without their help this tutorial probably never would have come about. If this is a problem, we can rename this version and base a new German translation on that.įrom Swen: thanks to Joost and Michael. Swen wants the German version to remain as-is. This tutorial is based on a German tutorial by Swen, but it is extended, especially after the Basic example. More experienced developers will hopefully be able to glance through the instructions and quickly understand what's going on.Īlso, you can stop at the end of the Basic example chapter and have a working program. As you can see at the end, the amount of actual code you will need for a working application is not that great. While this tutorial may seem long, it mostly is just a lot of text that explains why you should type what you type. Other databases can also be used some adjustments will need to be made which are mentioned in the text. If somebody is looking for basics about databases and SQL, he should read relevant books/documentation.įor this tutorial I use Firebird with the example database employee.fdb. This tutorial shows you how to program databases using practical example code based on the SQLdb Package.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |