Sign in Join
Wiki copytemporary

Lazarus Database Overview/ja

English · Español · Français · Polski · Русский · 日本語


データベースのポータル
参照: · Databases 概要 · ライブラリ · フィールドの型 · コントロール · FAQ · SqlDBHowto/ja · TSQLQuery の利用 · メモリ上で動作するデータベースの作り方 · チュートリアル/練習となる記事: · 概要 · 0 - データベースのセットアップ · 1 - 開始 · 2 - 編集 · 3 - クエリ · 4 - データモジュール · SQLdb Programming Reference/ja · 各種データベース · Advantage - MySQL - MSSQL - Postgres - Interbase - Firebird - Oracle - ODBC - Paradox - SQLite - dBASE - MS Access - Zeos

概要

この記事は、 Lazarus で動くデータベースに関する概要です。

Lazarus はいくつかのデータベースをインストール時にサポートしています(例えば SQLDB フレームワークを用いるなど)。しかし、プログラム作成者は必要とされるパッケージ(クライアントライブラリ)をインストールする必要があります。

あなたは、コードを通して、またはフォームにコンポーネントをドロップすることで、データベースにアクセスできます。 data-aware コンポーネント は フィールド を表し、TDataSource/jaにポイントする DataSource プロパティ を設定することで、接続されます。 Datasource は テーブルを表し、DataSet プロパティ を設定することで、データベース コンポーネント (例: TPSQLDatabase/ja や TSQLiteDataSet/ja) に接続されます。 data-aware コンポーネントは Data Controls tab/ja にあります。 Datasource とデータベースのコントロールは、 "Data Access" タブにあります。

Lazarus/FPC のビルトインのデータベースアクセスや、Firebird, MySQL, SQLite, PostgreSQL などに適したものは、以下のチュートリアルを参照してください。:

Lazarus と Interbase / Firebird

Lazarus と MySQL

  1. ビルトインの SQLdb によるサポート
  2. PDO(Pascal Data Objects)
  3. Zeos
  4. MySQL data access Lazarus components

Lazarus と MSSQL/Sybase

Microsoft SQL Server データベースには、以下の方法で接続できます。

  1. SQL Server data access Lazarus components。 これらは Windows と Mac OS X 上で動きます。ダウンロードは自由にできます。
  2. ビルトインの SQLdb コネクタである TMSSQLConnection と TSybaseConnection (Lazarus 1.0.8/FPC 2.6.2 以降)。: mssqlconn/jaも参照のこと。
  3. Zeos コンポーネントの TZConnection (最新の CVS は、このページのどこかにある Zeos へのリンク先を見てください。)
  4. On Windows you can choose between native library ntwdblib.dll (protocol mssql) or FreeTDS libraries (protocol FreeTDS_MsSQL-nnnn) where nnnn is one of four variants depending on the server version. For Delphi (not Lazarus) there is also another Zeos protocol ado for MSSQL 2005 or later. Using protocols mssql or ado generates code not platform independient.
  5. On Linux the only way is with FreeTDS protocols and libraries (you should use libsybdb.so).
  6. ODBC (MSSQL and Sybase ASE) with SQLdb TODBCConnection (consider using TMSSQLConnection and TSybaseConnection instead)
  7. See also 1(http://wiki.freepascal.org/ODBCConn#Connecting_to_Microsoft_SQL_Server)
  8. On Windows it uses native ODBC Microsoft libraries (like sqlsrv32.dll for MSSQL 2000)
  9. On Linux it uses unixODBC + FreeTDS (packages unixodbc or iodbc, and tdsodbc). Since 2012 there is also a Microsoft SQL Server ODBC Driver 1.0 for Linux which is a binary product (no open source) and provides native connectivity, but was released only for 64 bits and only for RedHat.

Lazarus と ODBC

ODBCはLinux、Windows、OSXで利用できる一般的な標準データベース接続である。データベースベンダからODBCドライバを供給してもらい、ODBCデータソース(DSNとしても知られる)を設定する。ODBCデータソースに接続するため、SQLDBコンポーネント(TODBCConnection/ja)を用いることができる。詳細と例に関してはODBCConn/jaを参照されたい

Microsoft Access

Windows、同様にLinuxでAccessデータベースにアクセスするためにODBCドライバを用いることができる: MS Access/jaを参照されたい

Lazarus と Oracle

  1. 組み込みの SQLDB サポート
  2. Zeos
  3. [devart.com/odac/ Oracle data access Lazarus component]

がある。

Lazarus と PostgreSQL

  1. 組み込みのSQLdb support. Component Palette/jaのSQLdb tab/jaコメント TPQConnection を参照されたい
  2. Zeos. Zeos Access パレットから'postgresql'のTZConnection を参照されたい
  3. [devart.com/pgdac/ PostgreSQL data access Lazarus component]

Lazarus と SQLite

SQLite は組み込み型のデータベースです。; データベースのコードはライブラリ(.dll/.so/.dylib)としてあなたのアプリケーションと共に提供できます。to make it self-contained (comparable to Firebird embedded). SQLite is quite popular due to its relative simplicity, speed, small size and cross-platform support.

Please see the SQLite page for details on various access methods, which include:

  1. ビルトインの SQLDb によるサポート。 SQLdb タブにあるコンポーネント TSQLite3Connection を使ってください。
  2. Zeos
  3. SQLitePass
  4. TSQLite3Dataset
  5. SQLite data access Lazarus components

Lazarus と Firebird/Interbase

InterBase (and FireBird) Data Access Components (IBDAC) is a library of components that provides native connectivity to InterBase, Firebird and Yaffil from Lazarus (and Free Pascal) on Windows, Mac OS X, iOS, Android, Linux, and FreeBSD for both 32-bit and 64-bit platforms. IBDAC-based applications connect to the server directly using the InterBase client. IBDAC is designed to help programmers develop faster and cleaner InterBase database applications.

IBDAC is a complete replacement for standard InterBase connectivity solutions. It presents an efficient alternative to InterBase Express Components, the Borland Database Engine (BDE), and the standard dbExpress driver for access to InterBase.

Firebird data access components for Lazarus are free to download.

Lazarus と dBase

FPC includes a simple database component that is derived from the Delphi TTable component called "TDbf" TDbf Website). It supports various DBase and Foxpro formats.

TDbf does not accept SQL commands but you can use the dataset methods etc and you can also use regular databound controls such as the DBGrid.

It doesn't require any sort of runtime database engine. However it's not the best option for large database applications.

See the TDbf Tutorial page for the tutorial as well as documentation.

You can use e.g. OpenOffice/LibreOffice Base to visually create/edit dbf files, or create DBFs in code using TDbf.

Lazarus と Paradox

Paradox was the default format for database files in old versions of Delphi. The concept is similar to DBase files/DBFs, where the "database" is a folder, and each table is a file inside that folder. Also, each index is a file too. To access this files from Lazarus we have these options:

TSdfDataset と TFixedDataset

TSdfDataSet/ja と TFixedFormatDataSet/ja は二つのシンプルな TDataSet/ja の後継機能であり、とても簡単なテキスト形式のデータベースを提供します。 これらのデータセットはオブジェクトパスカルのユニットに完全に実装されており、外部のライブラリが不要なことからも、小さなデータベースにとても便利です。 また、それらはテキスト形式のフォーマットであることから、簡単にテキストエディタで中身を見たり、編集したりできます。

サンプルコードとしては、 CSV/ja もご覧ください。

Lazarus と Advantage Database Server

関連情報

(アルファベット順にソートしています。)

外部リンク


From the Free Pascal wiki, page "Lazarus Database Overview/ja", as the Internet Archive kept it on 2025-01-17, last changed on 2024-09-23. 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.

Revision 2, last changed by WikiArchive .

Edited on wiki.freepascal.org by 2 people, 2017–2024

From the official wiki's backup of 26 May 2024: who edited this page there, and when. Edits made there after that date were not recorded, and the earlier versions are not shown here; the main page says why.

WhenWhoWhat changed
MiyatakejiroCreated page
Miyatakejiro
Miyatakejiro
Miyatakejiro
Miyatakejiro概要
Miyatakejiro概要
AribenLazarus と Interbase / Firebird

Talk about this page

Nobody has opened a bench for this page yet. Sign in to open one.