Sign in Join
Wiki copytemporary

Databases/zh CN: what changed

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

OldNewLine
11## 介绍
22
33本页面介绍了**Lazarus和数据库**。下表提供了所支持的数据库。
44
55**警告:**你应该只安装已经安装过客户端的数据库组件(如果数据库支持客户端支持)。否则Lazarus可能无法启动,因为丢失文件。那么你将不得不重新安装Lazarus,因为你不能卸载组件。
66
77### 数据库支持
88
99| 数据库 | 包名 | 需要客户端库? | 需要服务端? | 支持版本 | 支持平台 |
1010|----|----|----|----|----|----|
1111| [**Advantage**](http://www.advantagedatabase.com/) | TAdsDataSet | 是 | 否 | 10.1 及以上 | i386: Linux, Win32 |
1212| **DBase** | [[Lazarus Tdbf Tutorial/zh CN|DBFLaz]] | 否 | 否 | III+, IV, VII | 所有 |
1313| **In memory** | memds | 否 | 否 | \- | 所有 |
1414| **In memory** | bufdataset | 否 | 否 | \- | 所有 |
1515| [**Interbase**](http://www.embarcadero.com/products/interbase-smp) | [[Firebird|SQLdb]] | 是 | 是 | 4 - 6 | i386: Linux, Win32 |
1616| [**Firebird**](http://www.firebirdsql.org/) | [[Firebird|SQLdb]] | 是 | 取决于<sup>1</sup> | 1 - 2.5 | i386: Linux, Win32 |
1717| **(Visual) FoxPro** | [[Lazarus Tdbf Tutorial|DBFLaz]] | 否 | 否 | 2.0, 2.5, 3.0 (不完全) | 所有 |
1818| [**Microsoft SQL Server**](http://www.microsoft.com/zh-cn/server-cloud/products/sql-server/) | SQLdb | 是 | 是 | 6- | FPC 2.6.2+. Linux, macOS, Win32, probably *BSD, probably Solaris<sup>2</sup> |
1919| [**MySQL**](http://www.mysql.com/) | [[mysql|SQLdb]] | 是 | 是 | 3.0 - 5.5 | i386: Linux, Win32 |
2020| **ODBC** | [[ODBCConn|SQLdb]] | 是 | 取决于 | 3.x <sup>3</sup> | i386: Linux, Win32 |
2121| [**Oracle**](http://www.oracle.com/cn/) | [[Oracle|SQLdb]] | 是 | 是 | \- | \- |
2222| **Paradox** | [[TParadoxDataSet]] | 否 | 否 | up to Table Level 7 (and up ??) | 所有 |
2323| [**PostgreSQL**](http://www.postgresql.org/) | [[postgresql|SQLdb]] | 是 | 是 | 6.6 - 8 | i386: Linux, Win32 |
2424| [**Sybase Adaptive Server Enterprise (ASE)**](http://www.sybase.com.cn/products/databasemanagement/adaptiveserverenterprise) | [[mssqlconn|SQLdb]] | 是 | 是 | 任何 | Linux, macOS, Win32, probably *BSD, probably Solaris<sup>2)</sup> |
2525| [**SQLite**](http://www.sqlite.org/) | [[sqlite|SQLdb]] | 是 | 否 | sqlite3 | i386: Linux, Win32 |
2626| [**SQLite**](http://www.sqlite.org/) | [[sqlite|TSQLite3Dataset]] | 是 | 否 | sqlite2,sqlite3 | i386: Linux, Win32 |
2727| **Text 文件** | sdf | 否 | 否 | \- | 所有 |
2828
29-<cite id="supported_db_1">[[Databases/zh CN|备注 (1):]]</cite> 你可以使用 Firebird 对Windows和Linux的嵌入式版本(可能在Mac OS X也行),也可以连接到基于Windows/Unix/macOS/FreeBSD的/其他运行 Firebird 服务器支持的平台
29+[[Databases/zh CN|备注 (1):]] 你可以使用 Firebird 对Windows和Linux的嵌入式版本(可能在Mac OS X也行),也可以连接到基于Windows/Unix/macOS/FreeBSD的/其他运行 Firebird 服务器支持的平台
3030
31-<cite id="supported_db_2">[[Databases/zh CN|备注 (2):]]</cite> 这些连接器使用FreeTDS 的库作为驱动程序,FreeTDS 文档表明,应该建立这些平台。Windows x86/x64可以在这里下载:[1](ftp://ftp.freepascal.org/fpc/contrib/windows/dblib_x32.zip) 和 [2](ftp://ftp.freepascal.org/fpc/contrib/windows/dblib_x64.zip)
31+[[Databases/zh CN|备注 (2):]] 这些连接器使用FreeTDS 的库作为驱动程序,FreeTDS 文档表明,应该建立这些平台。Windows x86/x64可以在这里下载:[1](ftp://ftp.freepascal.org/fpc/contrib/windows/dblib_x32.zip) 和 [2](ftp://ftp.freepascal.org/fpc/contrib/windows/dblib_x64.zip)
3232
33-<cite id="supported_db_3">[[Databases/zh CN|备注 (3):]]</cite> 此版本号指的是ODBC标准,而不是一个驱动程序或驱动程序管理器的版本号。ODBC 3.x驱动对于大多数DBMS。
33+[[Databases/zh CN|备注 (3):]] 此版本号指的是ODBC标准,而不是一个驱动程序或驱动程序管理器的版本号。ODBC 3.x驱动对于大多数DBMS。
3434
3535## 数据库客户端绑定
3636
3737If you want to use one of the databases that need client libraries, those libraries have to be installed. Not only on the computer you're programming on, but also on the computers where the application must run. Note that some databases (in particular MySQL) only work if the bindings which are compiled in the application are from the same version as those of the installed libraries. You can find out how to install those libraries (.so files on *nix systems, and .dlls on windows) on the website of the database developers. The binding units can be found in the packages/base directory in the fpc-sources. They basically consist of the client API calls like mysql_connect_database, which are completely different for each database. It is possible to write database applications using these units, but it is usually far more work and bug-sensitive than using the DB-unit Lazarus components.
3838
3939Most of these bindings packages are hard-linked to the client libraries. This means that if the application is compiled with one of these units in it, the whole application can not be linked if the client libraries are not available on the workstation. This means that your program executable will not be generated if you do not have installed - for example - a MySQL client on your computer, and you are using the mysql4.pp unit in your program. If you succeed in compiling the program on a computer which has the MySQL client libraries installed, it still won't start on any other machine without the appropriate MySQL client libraries. In other words: for these databases, you need to install client libraries on your development machine, and you need to install these client libraries with your application.
4040
4141To avoid such problems some of the packages are also able to link dynamically to the libraries. Before any calls to those libraries can be made, the unit has to be 'initialized'. This initialization fails if the database client isn't installed on the computer. If the program is ready using the client library, the unit has to be 'released'.
4242
4343## 数据集
4444
4545Database use in Lazarus (or Free Pascal) is fundamentally based on the TDataset class. This represents a table or query to your application. However, like many other such fundamental classes, you don't use the TDataset class itself, you use a descendant of it. There are many of these. They provide access to different kinds of databases, such as local dbase or text files, or back-end databases such as PostgreSQL, Firebird, MySQL and so forth. Some dataset descendants link directly to database tables, while others use additional components or libraries to perform the link.
4646
4747Dataset descendants, being non-visual components are (usually) part of the Free Component Library (FCL) rather than the Lazarus Component Library (LCL).
4848
4949Datasets can be used both programmatically and with visual controls. A typical Lazarus database application will often use both methods. In either case, the first step is to create the TDataset descendant, initialise it to connect to the table or query you want, and open it. This can be done either in code at run time or by putting a component on your form and setting it's properties at design time. The details of this vary considerably with different TDataset descendants, so see the various guides under [[Databases]] for what has to be done for your database.
5050
5151When the dataset is opened, a set of field components are created, one for each field or column of the table or query you opened. Each field component is a descendant of TField, appropriate to the particular data type of the field, eg, TStringField.
5252
5353### 使用数据集代码
5454
5555Programmatic access will be explained in more detail in [[Using Dataset and Field components]], but as a very simple overview:
5656
5757- Use the TDataset descendant to open the table or query, filter the rows you want to see, and to move from row to row.
5858- Use the TField descendants to:
5959 - Access general information about fields
6060 - Access the specific data values for the current row. (use the As... properties, such as AsString, AsInteger, etc.)
6161- Access the fields of a TDataset descendant by using either:
6262 - The fields property, eg Fields\[0\] is the first field,
6363 - The FieldByName method, eg FieldByName('AGE') returns the field associated with the database field called 'AGE'
6464
6565See [[Database field type]] for a list of field types.
6666
6767### 使用可视化(数据感知)控制
6868
6969To use databases in a simple, "RAD" style Lazarus application, you usually configure the dataset descendant at design time and the use the data-aware controls. To do this:
7070
7171- Add the dataset descendant for the database of your choice, together with any supporting components, to your form, and open it (Set the 'Active' property to true)
7272- Add a TDatasource component (from the "Data Access" tab) to the form, and "link" it to the dataset (set the DataSet property)
7373- Add data-aware controls from the "Data Controls" tab to the form, and link each one to the DataSource (not dataset) component
7474- Most controls link to a single field, so you also need to set the Field for each tab.
7575
7676See #Data Controls below for more details on the controls
7777
7878### 数据集状态
7979
8080Datasets can be in a number of states. While there are quite a few (look up TDataSetState in the source), the main ones to be aware of initally are
8181
82-<table>
83-
84-<tr>
85-
86-<th>
87-
8882State
8983
90-</th>
91-
92-<th>
93-
9484Function
9585
96-</th>
97-
98-</tr>
99-
100-<tr>
101-
102-<td>
103-
10486dsInactive
10587
106-</td>
107-
108-<td>
109-
11088The dataset is closed
11189
112-</td>
113-
114-</tr>
115-
116-<tr>
117-
118-<td>
119-
12090dsBrowse
12191
122-</td>
123-
124-<td>
125-
12692The user can browse through the dataset, looking at values
12793
128-</td>
129-
130-</tr>
131-
132-<tr>
133-
134-<td>
135-
13694dsEdit
13795
138-</td>
139-
140-<td>
141-
14296The user can edit values on the current row. Values are not saved until a post is performed.
14397
144-</td>
145-
146-</tr>
147-
148-<tr>
149-
150-<td>
151-
15298dsInsert
15399
154-</td>
155-
156-<td>
157-
158100A new row has been added, and the user can set the values. The record is not saved until a post is performed
159101
160-</td>
161-
162-</tr>
163-
164-</table>
165-
166102The other states are fairly transitory, and are usually handled "automatically". They are used internally and in more complicated code. If your database only views data, and you open the dataset at design time, you can largely ignore the state, as it will mostly be dsBrowse. However, most applications will want to change the data at some stage. If you are using data-aware controls, they will handle a lot of this automatically. If you change the text in a DBEdit control, for example, it will put the dataset into dsEdit state - unless you are already in dsEdit or dsInsert. If you "scroll" to a different record while the current state is dsEdit or dsInsert, that record will be "posted" and the dataset revert to dsBrowse. However, if you are accessing the dataset from code, you will often have to change the state in code as well. The dbNavigator control (see below) allows the user to change the state explicitly.
167103
168104### 数据集 UpdateStatus
169105
170106UpdateStatus determines the current state of the record buffer, if updates have not yet been applied to the database.
171107
172108**Example** how to detect if ApplyUpdates will Insert, Update or Delete data:
173109
174110``` pascal
175111procedure QueryAfterPost(DataSet: TDataSet);
176112begin
177113 case DataSet.UpdateStatus of
178114 usUnmodified : ShowMessage('Unmodified');
179115 usModified : ShowMessage('Modified');
180116 usInserted : ShowMessage('Inserted');
181117 usDeleted : ShowMessage('Deleted');
182118 end;
183119end;
184120```
185121
186122**Value Explanation:**
187123
188124- usUnmodified: Record is unmodified
189125- usModified: Record exists in the database but is locally modified
190126- usInserted: Record does not yet exist in the database, but is locally inserted
191127- usDeleted: Record exists in the database, but is locally deleted
192128
193129### 提交和取消
194130
195131If you have edited or inserted a record, the new values are held in a buffer.
196132
197133- Calling the dataset cancel method removes the new record (insert) or reverts the values to their previous values (edit).
198134- Calling the dataset post method saves the values (edit) or record (insert). In some dataset descendants, they will be written to the database immediately, while in others they will be stored in a list of updates until a further call is made to save all changes to the database. Finally, even when they are written to the database, you may still have to call a "commit" method to make the database write them permanently. All of this also varies considerably with the dataset descendant, so look up the details for the one you are using.
199135
200136### 插入新记录
201137
202138To insert a new record into a TDataset descendent, one should use the method [Insert](http://www.freepascal.org/docs-html/fcl/db/tdataset.insert.html). After that one can set the field values and then finally call Post to commit the new record, as the example below shows.
203139
204140The example also shows how to insert BLOB data from a file - you can also use LoadFromStream to load the data from a stream.
205141
206142``` pascal
207143 MyDataset.Insert;
208144 MyDataset.Fields[0].AsInteger := 4; //an integer field
209145 MyDataset.Fields[1].AsString := 'First Name'; //a string field
210146 TBlobField(MyDataset.Fields[2]).LoadFromFile('SomeBlobfile.bin'); //blob field
211147 MyDataset.Post;
212148```
213149
214150### 如何快速跳转到特定记录
215151
216152#### 选择所有记录
217153
218154If you use SELECT * FROM to select all records of the table and then desires to quickly jump between them, you will have to build an index and search on it. It is more efficient to select only the record that you want.
219155
220156#### 选择所需记录
221157
222158One fast solution to jump to a particular record is to select only it, for example doing:
223159
224160``` pascal
225161var
226162 MyDataset: TSQLQuery;
227163begin
228164 //...
229165 MyDataset.FieldDefs.Add('SessionId', ftLargeint);
230166 MyDataset.FieldDefs.Add('GameEvent', ftLargeint);
231167 MyDataset.FieldDefs.Add('TableId', ftInteger);
232168 MyDataset.FieldDefs.Add('LoggedIn', ftBoolean);
233169 MyDataset.FieldDefs.Add('PlayerId', ftInteger);
234170 MyDataset.Active := False;
235171 { Non-parameterized format; may run into issues with text containing ' and dates
236172 SQLText := Format('select * from "GameSession" WHERE "SessionId"=%d', [ASessionId]);
237173 }
238174 // Solution: parameterized query:
239175 // Actually, if this is done in a loop, you only need to set the SQL.Text once,
240176 // and only change the parameter value
241177 MyDataset.SQL.Text := 'select * from "GameSession" WHERE "SessionID"=:SessionID');
242178 MyDataSet.ParamByName('SessionID').AsLargeInt := ASessionID;
243179 try
244180 MyDataset.Active := True;
245181 except
246182 //...
247183 end;
248184```
249185
250186You can then read information using something like this:
251187
252188``` pascal
253189 lPlayerId := MyDataset.Fields[4].AsInteger;
254190```
255191
256192### 过滤
257193
258194You can filter your dataset to restrict the records to a subset you want (e.g. all surnames starting with Smith).
259195
260196- Using .Filter:
261197 - TDBF, BufDataset and descendants (including TSQLQuery) use the TDBF filtering parser; see [[Lazarus Tdbf Tutorial|Lazarus Tdbf Tutorial#Expressions]] for details on using this.
262198 - TMemDS does not support .Filter
263199- Using a callback/event procedure with OnFilter where you can program your own filter function
264200
265201### 定位/查找
266202
267203Although more often used in non-SQL datasets (e.g. Paradox, TDBF) you can jump between records using [[locate]]/[[lookup]].
268204
269205### 使用 TSQLQuery
270206
271207For more information about TSQLQuery see [[Working With TSQLQuery]]
272208
273209### 导出
274210
275211FPC/Lazarus contains functionality to let you export datasets to various formats; see e.g.
276212
277213- [[fpXMLXSDExport]]
278214- [[fpdbfexport]]
279215- the other components on the Data Export tab
280216
281217Of course, you could also do it manually (see e.g. [[FPSpreadsheet|FPSpreadsheet#Converting_a_database_to_a_spreadsheet]] for export to Excel format using fpspreadsheet)
282218
283219## 数据控制
284220
285221To use any of these controls, add the control to a form and set at least the datasource property. Other key properties will be noted.
286222
287223### 数据源控制
288224
289225This control keeps track of which record the linked controls currently are on. The datasource contorl must be linked to a dataset (e.g. a TSQLQuery).
290226
291227### 单字段控制
292228
293229These controls all attach to a single field. As well as datasource, set the field name. Controls include:
294230
295231- [[doc:lcl/dbctrls/tdbtext.html|DBText control]] Displays a text field (readonly, no border)
296232- [[doc:lcl/dbctrls/tdbedit.html|DBEdit control]] Displays / edits a text field as an edit box
297233- [[doc:lcl/dbctrls/tdbmemo.html|DBMemo control]] Displays / edits a text field in a multi-line edit box
298234- [[doc:lcl/dbctrls/tdbimage.html|DBImage control]] Displays a picture stored in a database as a BLOB. Note: by default, Lazarus stores a header with the image type before the image data in the database BLOB field. This is different from Delphi. However, you can make TDBImage Delphi compatible: see [[Lazarus For Delphi Users|Lazarus For Delphi Users#TDBImage]]
299235- [[doc:lcl/dbctrls/tdblistbox.html|DBListBox control]] and [[doc:lcl/dbctrls/tdbcombobox.html|DBComboBox Control]] Allow the user to insert values into a database field from the list of values in the Items property of the controls
300236- [[doc:lcl/dbctrls/tdblookuplistbox.html|DBLookupListBox control]] and [[doc:lcl/dbctrls/tdblookupcombobox.html|DBLookupComboBox control]], see also [[dblookupcombobox]] Allow the user to insert values into a database field by displaying the contents of a lookup field in another table. Though these controls store their results in a single field, you need another field for the lookup values. **Note**: at lest for DBLookupComboBox, there is a bug with FPC 2.6.0 that requires the listfield to be present in the datasource as well, you can bypass it by declaring a calculated field with the same name as the listfield in the datasource's dataset that does nothing.
301237- [[doc:lcl/dbctrls/tdbcheckbox.html|DBCheckBox control]] Displays / edits a boolean field by checking/clearing a check box
302238- [[doc:lcl/dbctrls/tdbradiogroup.html|DBRadioGroup control]] Displays the items as in a normal radio group, reading/setting the field value from a matching values list
303239- [[doc:lcl/dbctrls/tdbcalendar.html|DBCalendar control]] Displays / edits a date field using a calendar panel
304240- [[doc:lcl/dbctrls/tdbgroupbox.html|DBGroupBox control]]
305241
306242### [[doc:lcl/dbgrids/tdbgrid.html|DBGrid control]]
307243
308244This control can show a number of fields in a row/column layout - in fact by default it shows them all. However, you can put entries into the [[doc:lcl/dbgrids/tdbgrid.columns.html|columns collection]] to restrict it to specific fields and to set the widths and titles of each column.
309245
310246Apart from the [[doc:lcl/dbgrids/tdbgrid.html|mentioned documentation]], some more detail can be found here: [[Grids Reference Page|Grids Reference Page#TCustomDBGrid]]
311247
312248### [Navigator Control](http://lazarus-ccr.sourceforge.net/docs/lcl/dbctrls/tdbnavigator.html)
313249
314250This control gives the user some direct control over the dataset. It allows the user to:
315251
316252- Move to the next or previous record, or to the start or end of the records
317253- Add a new record (equivalent to a dataset.insert method call)
318254- Put the dataset into edit mode
319255- Delete a record
320256- Post or Cancel current changes
321257- Refresh the data (useful in multiuser database applications)
322258
323259Key Properties:
324260
325261- VisibleButtons: Lets you control what the user can do. For example, if deletes are not allowed, hide the delete button. If you have a DBGrid attached to the same dataset, you may decide you do not need the next and prior buttons.
326262- Width: If you do not show all buttons, you may want to set the width to (height*number_of_visible_buttons)
327263
328264## 运行FPC数据库测试
329265
330266Free Pascal database components include a [[fpcunit]]-based test framework, dbtestframework, that can be used to verify functionality. See the directory source\packages\fcl-db\tests\\ in your FPC source tree. Included is a test framework that can be run on various database components, as well as some other tests (e.g. test of database export).
331267
332268To run the test framework on a certain database:
333269
3342701\. 保存 source\packages\fcl-db\tests\database.ini.txt as source\packages\fcl-db\tests\database.ini
335271
3362722\. 修改 source\packages\fcl-db\tests\database.ini to choose which database type you will use.
337273
338274Example for Interbase/Firebird:
339275
340276``` ini
341277[Database]
342278type=interbase
343279```
344280
3452813\. In the same file, customize settings for your database. E.g. if you chose interbase before:
346282
347283``` ini
348284[interbase]
349285connector=sql
350286connectorparams=interbase
351287; Database name/path (note: database needs to exist already)
352288; You can use aliases (see aliases.conf in your Firebird documentation)
353289name=testdb
354290user=sysdba
355291password=masterkey
356292; your hostname may very well differ:
357293; Leave blank if you want to use an embedded Firebird database
358294hostname=192.168.0.42
359295```
360296
3612974\. Compile and run source\packages\fcl-db\tests\dbtestframework.pas (You can also use Lazarus to compile and run the GUI version, dbtestframework_gui) If you are using an embedded database on Windows (e.g. Firebird embedded or sqlite), copy the required DLL files to the directory first. The output will be in XML format (or displayed on your screen if you use dbtestframework_gui).
362298
363299Please see source\packages\fcl-db\tests\README.txt for more details.
364300
365301## Lazarus包含数据库包
366302
367303### sqldblaz.lpk
368304
369-<figure>
370-<img src="sqldbcomponents.png" title="sqldbcomponents.png" />
371-<figcaption>sqldbcomponents.png</figcaption>
372-</figure>
305+![](/wiki-images/c/cc/Sqldbcomponents.png)
373306
374307This package provides access to different databases. These include:
375308
376309- Interbase/Firebird
377310- Microsoft SQL Server (except on Lazarus/FPC x64 for Windows)
378311- MySQL
379312- Oracle (except on Lazarus/FPC x64 for Windows)
380313- PostgreSQL (except on Lazarus/FPC x64 for Windows)
381314- SQLite (with support for the [[Spatialite]] extension)
382315- Sybase ASE (Adaptive Server Enterprise - not to be confused with Sybase ASA) (except on Lazarus/FPC x64 for Windows)
383316- any database that has an ODBC driver.
384317
385318The components (TSQLQuery, TSQLTransaction, TIBConnection, TODBCConnection, TOracleConnection, TMSSQLConnection, TMySQL40Connection, TMySQL41Connection, TMySQL50Connection, TPQConnection, TSybaseConnection) are on the 'SQLdb' tab in the component palette.
386319
387320- [[SQLdb Package]]
388321
389322### dbflaz.lpk
390323
391324This package provides access to dBase and FoxPro databases. You can get more information in the [[Lazarus Tdbf Tutorial]]. The TDbf component is on the 'Data Access' tab in the component palette.
392325
393326### sqlitelaz.lpk
394327
395328This package provides access to SQLite databases. You can get more information in the [[Lazarus Database Overview]].
396329
397330### sdflaz.lpk
398331
399332The component TSdfDataSet can be found on the 'Data Access' tab in the component palette.
400333
401334### lazreport.lpk
402335
403336The homepage of the report generator is [<http://lazreport.sourceforge.net/>](http://lazreport.sourceforge.net/). More informationen (et al. an additional link) can be found [[Projects using Lazarus|here]]. LazReport depends on the Printer4Lazarus package. With revision 11950 LazReport was included in the Lazarus SVN repository.
404337
405338## 外部包/库
406339
407340### Zeos 数据库对象
408341
409342These components provide access to different databases. You can find more information [[ZeosDBO|here]]. This wiki also contains a [[Zeos tutorial]].
410343
411344### Pascal 数据对象
412345
413346There is now an alternative.
414347
415348支持:
416349
417350- MySQL 4.1 and 5.0
418351- sqlite-2 and sqlite-3
419352- pgsql-8.1
420353- interbase-5, interbase-6, firebird-1.0, firebird-1.5, firebird-1.5E, firebird-2.0, firebird-2.0E
421354- mssql (Microsoft library) and sybase (FreeTDS library)
422355- oracle
423356
424357like prepared statements, binding, and stored procedures are supported by database API called Pascal Data Objects, which is inspired by PHP Data Objects. All the code and documentation necessary to use this new API is available on Sourceforge:
425358
426359<http://pdo.sourceforge.net>
427360
428361### TPSQL
429362
430363These components provide access via TCP/IP to PostgreSQL databases. You can find more information on [[TPSQL|this page]].
431364
432365### FIBL
433366
434367These components provide access to Interbase and Firebird databases. The homepage is [<http://sourceforge.net/projects/fibl>](http://sourceforge.net/projects/fibl).
435368
436369### IBX
437370
438371IBX For Lazarus are components to access Firebird databases: see [[IBX]]
439372
440373### FBLib Firebird 库
441374
442375[FBLib](http://fblib.altervista.org/) is an open Source Library No Data Aware for direct access to Firebird Relational Database from Borland Delphi/Kylix, Free Pascal and Lazarus.
443376
444377Current Features include:
445378
446379- Direct Access to Firebird 1.0.x, 1.5.x and 2.x Classic or SuperServer
447380- Multiplatform \[Win32,Gnu/Linux,FreeBSD)
448381- Automatic select client library 'fbclient' or 'gds32'
449382- Query with params
450383- Support SQL Dialect 1/3
451384- LGPL License agreement
452385- Extract Metadata
453386- Simple Script Parser
454387- Only 100-150 KB added into final EXE
455388- Support BLOB Fields
456389- Export Data to HTML SQL Script
457390- Service manager (backup,restore,gfix...)
458391- Events Alerter
459392
460393You can download documentation on [FBLib's website](http://fblib.altervista.org/).
461394
462395### Unified Interbase
463396
464397UIB provides access to Interbase, Firebird and YAFFIL databases. The homepage is [www.progdigy.com](http://www.progdigy.com). A svn repository is available under <https://uib.svn.sourceforge.net/svnroot/uib> .
465398
466399### TechInsite Object Persistence 框架 (tiOPF)
467400
468401More information about tiOPF can be found on this [[tiOPF|page]].
469402
470403### Advantage TDataSet Descendant
471404
472405The Advantage TDataSet Descedant provides a means of connecting to (and opening tables with) the Advantage Database Server. Advantage is a flexible, administration-free embedded database that provides Client/Server as well as Peer-to-peer access to Clipper, FoxPro and Visual FoxPro 9 DBF file formats, as well as a proprietary file format that provides a migration path allowing the use of newer features.
473406
474407Key Features:
475408
476409- Royalty-free peer-to-peer database access with migration path to Client/Server
477410- Multi-Platform (Clients supported on Windows and Linux, Server supported on Windows, Linux, and NetWare)
478411- Supports Both navigational and relational SQL database access
479412- Full-text search engine
480413- Table, Index, Memo, and communication encryption
481414- Compatible with native TDataset components
482415- Online Backup
483416- Server supports Replication
484417
485418For more information, see the [Advantage Database Server](http://www.advantagedatabase.com) website.
486419
487420### ZMSQL, sql-enhanced 内存数据库
488421
489422For more information, see the [ZMSQL wiki page](http://wiki.lazarus.freepascal.org/ZMSQL)
490423
491424ZMSQL is an open source, TBufDataset descendant SQL enhanced in-memory database for Free Pascal (FPC), operating with semicolon-separated values flat text tables. Completely written in Pascal, it has no dependencies on external libraries. It uses JanSQL engine for SQL implementation.
492425
493426它提供了:
494427
495428- Loading from and saving to flat text tables
496429- Use of SQL to query the data
497430- Copy data and schema from other datasets
498431- Option to predefine fielddefs or create it on-the fly
499432- Master/detail filtering
500433- Referential integrity
501434- Parameterized queries
502435
503436The download contains the source code, some demo applications illustrating the features of the component as well as a readme.
504437
505438## 参见
506439
507440- [[Portal:Databases|Database Portal]]
508441- [[Lazarus DB Faq]]
509442
510443---
511444*From the Free Pascal wiki, page "Databases/zh CN", as it stood on 2020-02-16 after a change by Trev, 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).*

Back to history