Working with DBISAM an embedded database engine using Microsoft .NET
DBISAM is a word that may seem new for many of us and many would be astonished to know that it is a database. Like any other database, it has the ability to maintain huge amounts of data. This article aims at providing an overview of DBISAM and the ways we can interact with the database through .NET. DBISAM is an embedded database engine which is available for programming languages that can use ODBC for data access. DBISAM can be used as a single-user, multi-user or client-server engine.
General Architecture
DBISAM is session based where each session is equivalent to a virtual user. In a given application there can be many active sessions. The sessions are of 2 types.
· Local Session: A local session can directly access the database tables via Windows or Linux APIs to the local storage medium.
· Remote Session: A remote session uses sockets to communicate to a database server over a network using TCP/IP protocol.
The main drawback of DBISAM is that it does not support Referential Integrity.
Databases
DBISAM uses the physical directories in Operating System’s file system to represent databases. The tables in DBISAM are represented by three physical files in the database.
· .dat (Data Files) which are the actual tables in the Database that store records.
· .idx (Index Files) which store index definitions and pages.
· .blb (BLOB Files) that store BLOB blocks related to tables.
After knowing a bit about database structure, let us put our hands on the programming part with relation to .NET. As every database has accepted SQL as the standard language for querying, so too has DBISAM. We do not need to worry about syntax; our same old concept on SQL will work fine here. Now to connect to the DBISAM Database from our application, we need the DBISAM ODBC driver. It is an ODBC level 3 driver. The driver works with Microsoft Data Access Components (MDAC) version 2.7 or higher and many other applications including .NET Applications.
Missing Features
There are still a few things missing from the driver like support for bulk operations and a few ODBC extended scalar functions (UNION, INTERSECT, LIKE, etc).
Using ODBC Driver
To use the ODBC Driver we can either setup a DSN which we access from our application or can directly access the database through a connection string from our application.
Depending on our application need and location of the database (local or remote), the connections may vary. It can be either done through a DSN or we can use a connection string to connect to the database.
Connection String
For direct connection strings the Keywords play a major role and are case sensitive. The Connection String Keywords available in DBISAM ODBC Driver are as follows:
· DRIVER: It specifies the ODBC driver name used.
· ConnectionType: Depends on the connection, i.e. Local or Remote.
· CatalogName: Specifies the name of the database.
These were the required Keywords for both Local and Remote Connections. The following keywords are required only for Remote connections.
· UID: Specifies the User ID for the remote connection.
· PWD: Specifies the password for the remote connection.
· RemoteHostName: Specifies the Host name of the remote Database server.
· RemoteIPAddress: Specifies the IP address of the remote Database Server.
From the RemoteHostName or RemoteIPAddress above, any one is used.
Can't find what you're looking for? Try Google Search!
Comments on "Working with DBISAM an embedded database engine using Microsoft .NET"