Sign in Join
Wiki copytemporary

TPSQL/es: what changed

Revision 2 to 3. Removed lines have a minus sign; added lines have a plus sign.

OldNewLine
11### Acerca de
22
33TPSQL e un paquete modificado bajo LGPL para Lazarus. Define dos componentes, TPSQLDatabase y TPSQLDataset, permitiendo a las aplicaciones conectar con servidores de bases de datos PostgreSQL en redes que utilizan TCP/IP.
44
55La descarga contiene los ficheros de componentes Pascal, el fichero de paquete para Lazarus y los ficheros de recursos junto con los ficheros de texto que describen la licencia modified-LGPL.
66
77Este componente fué diseñado para su utilización en aplicaciones corriendo bajo plataformas Linux y Win32.
88
99### Autor
1010
1111Antonio d'Avino
1212
1313### Licencia
1414
1515LGPL modificada (leer COPYING.modifiedLGPL y COPYING.LGPL que se incluyen en el paquete).
1616
1717### Descarga
1818
1919La última versión estable se puede encontrar en [Lazarus CCR Files page](http://sourceforge.net/project/showfiles.php?group_id=92177&package_id=98986) o en la página web del autor [<http://infoconsult.homelinux.net>](http://infoconsult.homelinux.net).
2020
2121### Historial de cambios
2222
2323- Version 0.4.0 2005/06/01
2424- Version 0.4.1 2005/06/02
2525
26-` - ClientEncoding property added to TPSQLDatabase class. `
26+```text
27+ - ClientEncoding property added to TPSQLDatabase class.
28+```
2729
2830- Version 0.4.2 2005/06/03
2931
30-` - Some changes to destroy method of TPSQLDatabase/TPSQLDataset for avoiding exception`\
31-`   when closing IDE/project with components in Active/Connected status.`\
32-` - Base path in archived files changed from 'usr/share/lazarus/components/psql' to 'psql'`
32+```text
33+ - Some changes to destroy method of TPSQLDatabase/TPSQLDataset for avoiding exception
34+ when closing IDE/project with components in Active/Connected status.
35+ - Base path in archived files changed from 'usr/share/lazarus/components/psql' to 'psql'
36+```
3337
3438- Version 0.4.6 2005/06/06
3539
36-` - Executing queries that doesn't return data column now raises an exception.`\
37-` - commandQuery function added (see Usage section).`\
38-` - beginTransaction/commitTransaction/rollbackTransaction support added (see Usage section).`\
39-` - More ClientEncoding entities added.`
40+``` pascal
41+ - Executing queries that doesn't return data column now raises an exception.
42+ - commandQuery function added (see Usage section).
43+ - beginTransaction/commitTransaction/rollbackTransaction support added (see Usage section).
44+ - More ClientEncoding entities added.
45+```
4046
4147### Dependencias / Requerimientos del sistema
4248
4349- Lazarus 0.9.6 (FPC 1.9.8)
4450
4551Stado: estable
4652
4753Issues: Testeado bajo Windows (Win2K) y Linux (Mdk 10.1). Servidor de base de datos: PostgreSQL 8.0.3 (corriendo en ambas plataformas).
4854
4955### Instalación
5056
5157- In the lazarus/components directory, untar (unzip) the files from psql-laz-package-\<version\>.tar.gz file. The psql folder will be created.
5258- Open lazarus
5359- Open the package psql_laz.lpk with Component/Open package file (.lpk)
5460- (Click on Compile only if you don't want to install the component into the IDE)
5561- Click on Install and answer 'Yes' when you are asked about Lazarus rebuilding. A new tab named 'PSQL' will be created in the components palette.
5662
5763**Nota importante para los usuarios de Win32.**
5864
59-`En caso de experimentar dificultades a la hora de compilar los ficheros Pascal del paquete, puede que se necesite añadir  la siguiente trayectoria:`\
65+``` pascal
66+En caso de experimentar dificultades a la hora de compilar los ficheros Pascal del paquete, puede que se necesite añadir la siguiente trayectoria:
6067
61-` `\
62-`<some-drive>:<some-path>\lazarus\lcl\units\i386-win32 `\
63-`(ie: c:\programs\lazarus\lcl\units\i386-win32)`\
64-` `\
65-`to the 'Other unit files ...' in 'Paths' tab of 'Compiler Options' of the lazarus package manager   `\
66-`window.`
68+
69+<some-drive>:<some-path>\lazarus\lcl\units\i386-win32
70+(ie: c:\programs\lazarus\lcl\units\i386-win32)
71+
72+to the 'Other unit files ...' in 'Paths' tab of 'Compiler Options' of the lazarus package manager
73+window.
74+```
6775
6876### Usage
6977
7078Drop a TPSQLDatabase component on a form, for any different PostgreSQL database your application needs to connect to. Mandatory property of this component you have to set are:
7179
7280- DatabaseName : The name of the PostgreSQL database that your application needs to connect to.
7381- HostName : the IP address or the URL of the PC hosting the PostgreSQL server.
7482- UserName : The name of an user having permission to access to host/database.
7583
7684Optionally you may need to set Password property for correct connection to server. Then, to activate the connection, you neet to set the Connected property to 'True'. An exception will be raised if connection failed (wrong parameters, user with no permission to access the host/database, network errors or PostgreSQL server not active). Set this property to 'False' for closing connection.
7785
7886**- Note about the ClientEncoding property.**
7987
80-`The ClientEncoding property allows user to set a character set for the client`\
81-`application different from the one defined for the database. The PostgreSQL server`\
82-`make a 'translation' between the two sets.  However a "ClientEncoding change failed" `\
83-`exception may be the result of a ClientEncoding property change. This may be due to`\
84-`a database character set incompatible with the clientencoding you selected. IE,  `\
85-`the char set 'LATIN9' is not compatible with a  'WIN1250'. You select the default`\
86-`char set for the whole database cluster when you create it with the command`\
87-`'initdb', using the -E option:  IE.   'initdb -E UNICODE'.  Also, you can define a`\
88-`different character set for any database you create (different from the `\
89-`default one of the whole db cluster),  also with the  -E option:`\
88+```text
89+The ClientEncoding property allows user to set a character set for the client
90+application different from the one defined for the database. The PostgreSQL server
91+make a 'translation' between the two sets. However a "ClientEncoding change failed"
92+exception may be the result of a ClientEncoding property change. This may be due to
93+a database character set incompatible with the clientencoding you selected. IE,
94+the char set 'LATIN9' is not compatible with a 'WIN1250'. You select the default
95+char set for the whole database cluster when you create it with the command
96+'initdb', using the -E option: IE. 'initdb -E UNICODE'. Also, you can define a
97+different character set for any database you create (different from the
98+default one of the whole db cluster), also with the -E option:
9099
91-`IE. 'createdb  -E UNICODE Test' `\
92-` `\
93-`                    or`\
100+IE. 'createdb -E UNICODE Test'
101+
102+ or
94103
95-`CREATE DATABASE TEST WITH ENCODING 'UNICODE';`\
104+CREATE DATABASE TEST WITH ENCODING 'UNICODE';
96105
97-`(note you must  quote the character set  name in the 'CREATE DATABASE' command).`\
106+(note you must quote the character set name in the 'CREATE DATABASE' command).
98107
99-`I suggest to set UNICODE character set as the default for your db cluster (or for the`\
100-`database you create), because it is compatible with the whole set of charset available`\
101-`for the client, except the MULE_INTERNAL.`
108+I suggest to set UNICODE character set as the default for your db cluster (or for the
109+database you create), because it is compatible with the whole set of charset available
110+for the client, except the MULE_INTERNAL.
111+```
102112
103113Now you may drop a TPSQLDataset component on the form for any table connection you need. The main property to set on this component type is the Database one. A dropdown menu allows you to select one of any TDatabase descendant component present on form (of course, you must select a TPSQLDatabase component).
104114
105115You also need to provide a valid SQL statement in SQL property. Now, you are able to open the TPSQLDataset, setting to 'True' the Active property. Several exceptions are provided for signaling failing conditions. Please, refer to TDataSet documentation for infos and examples about using the TPSQLDataset component in order to access to SQL retrieved data rows as well as conneting to Data Controls components. However, procedures and functions added to parent class are explained here:
106116
107117\- function **commandQuery ( query : String) : ShortInt**.
108118
109-`Use this function for submit queries that doesn't returns data columns, as update queries`\
110-`(ie. update, insert, delete etc.). Current dataset is not affected, however it will reflect `\
111-`changes made by execution of commandQuery itself, if it has some influence on current `\
112-`dataset.Function returns 0 if succeded, -1 if failed. No exceptions are provided.`
119+``` pascal
120+Use this function for submit queries that doesn't returns data columns, as update queries
121+(ie. update, insert, delete etc.). Current dataset is not affected, however it will reflect
122+changes made by execution of commandQuery itself, if it has some influence on current
123+dataset.Function returns 0 if succeded, -1 if failed. No exceptions are provided.
124+```
113125
114126\- procedure **beginTransaction**
115127
116-`                          Starts a SQL transaction session. Changes to table may be submitted`\
117-`                          using the commandQuery function.`
128+``` pascal
129+ Starts a SQL transaction session. Changes to table may be submitted
130+ using the commandQuery function.
131+```
118132
119133\- procedure **commitTransaction**
120134
121-`                          Ends a SQL transaction session, commiting changes submitted starting`\
122-`                          from last beginTransaction execution.`
135+```text
136+ Ends a SQL transaction session, commiting changes submitted starting
137+ from last beginTransaction execution.
138+```
123139
124140\- procedure **rollbackTransaction**
125141
126-`                          Ends a SQL transaction session, aborting changes.`
142+```text
143+ Ends a SQL transaction session, aborting changes.
144+```
127145
128146---
129147*From the Free Pascal wiki, page "TPSQL/es", as it stood on 2012-05-22 after a change by Iskraelectrica, out of the wiki's dump of 2024-05-26. Copyright stays with the author who wrote it, according to the old wiki's [[Licensing]] page. If you have concerns about this material, [message the admin](/wiki-contact).*
130148Category: Castellano
131149Category: Español

Back to history