|
Software Development Kit to the Delphi-Win32 and Free Pascal compilers |
| Home > Wiki > PhonebookProject/Article3 |
PhonebookProject/Article3english (en) | português (pt)
This article will present the creation of the database and configuring the connector to access data.
[edit] Creation of databaseCreate a new database to store the objects of the project. Then run the application, press Shift + Alt + 9 to copy the database's metadata to the clipboard. Adapt the script to the preferences of collation and character set of columns and run it on the database front-end. Record the final script in the folder {phonebook}\Source\Metadata\Firebird\firebird.sql or in the folder of the database used. This script is useful to run a diff and create a script to change the metadata of the database in future articles. [edit] Connector ConfigurationCreate the file {phonebook}\Source\Core\Projects\D5\PhoneBook.cf (ie, ProjectName.cf in the same folder as executable) with the following contents: [OPFBroker] DefaultServiceName := 'UIB'; [OPFBroker.UIB] Connector.Database.CharacterSet := csISO8859_1; Connector.Database.LibraryName := 'fbclient.dll'; Connector.Database.DatabaseName := 'localhost:c:\data\PhoneBook.fb'; Connector.Database.UserName := 'SYSDBA'; Connector.Database.PassWord := 'masterkey'; The above example uses UIB to connect to a Firebird database. [edit] Using another connectorTo use another connector:
The properties of this sub-session are all public properties (published) in OPFBroker service class. If these properties are a class, all published properties of that class are also available as a path: ServiceProp.OutherClasseProp.ValueProp := 'value'; To know these properties, check the class declaration unit of their broker. For the UIB connector, the service is stated in the unit {press}\Source\Brokers\PressUIBBroker.pas. [edit] Finalizing and testing the applicationThe configuration of the database and the connector is the last step of building the application. The only PressObjects dependence, to the deployment of the application is the configuration file (PhoneBook.cf). Put him with the other dependencies, as the client library database and library of the connection (if any). New articles will deal with application improvements, such as: events, grid personalization, access control, reports at runtime, the dababase's encrypted password, among others.
|
Personal tools |