DBConn
An ODBC Database Plugin for DarkBASIC Professional
Now available for download DBConn_1_1_5.zip.
Release Notes:
1.0.0 - Initial Release
1.0.15 - Fixed : Dataset was not being reset properly, so any data retrieved after the first SELECT would end up in the wrong position within the dataset.
1.1.4 - Added : 10 new commands to pull specific types of data from your database without having to convert them from a string.
1.1.5 - Fixed : Bug in the DBExecute command always returned 1 when successful, instead of the number of rows affected by the command.
DBConn is an ODBC Database Plugin for DarkBASIC Professional written in C# 2008 .Net and converted using ZKat8It's .Net DLL Converter which can be found at http://www.virtualdarkarts.com.
DBConn is designed to allow you to access any database file, system, or server that has an ODBC compliant driver. It has been tested with Microsoft SQL Server, MySQL Server using the MySQL ODBC Driver v3.51, and with a Microsoft Access 2000 mdb file.
When you first use DBConn, you must use the DBConnect command first. This sets the connection string to your database, opens the connection, verifies that it worked, and returns a result code letting you know whether it connected or not. If it did connect, then that connection remains open until one of 3 things happens. 1. The connection times out on it's own, and the ODBC driver closes it. 2. You close it by ending your program. 3. You use the DBConnect command again, in which case it will close the current connection and open a new connection with the connection string you supply.
While the connection is open, DBConn will let you use the other commands to access your data without having to re-open the database every time. If the connection should close on it's own due to a timeout, the other commands first check to make sure the connection is open, and if it isn't, the connection is automatically re-opened, and then your command is processed. This method saves you a lot of time. You don't have to worry about the status of the connection. Just set the connection string once, and the rest is all handled for you. The connection drops when it's not in use, but stays open during periods of frequent usage.
Due to this feature, it is not recommended to use this DLL for a client/server application where multiple clients will be accessing the database server, as you might run out of available connections on the database server.
DBConn Commands
DBConnect -- Connects to the database and sets the connection string
DBExecute -- Executes a NON-QUERY SQL statement on your database
These would be commands that don't return a dataset, such
as INSERT or DELETE.
DBRunSQL -- Executes a QUERY SQL statement on your database. This
command returns the number of rows that it has retrieved
from your query, and has stored those results in a persistent
dataset for you to retrieve your data from. The data remains
in the dataset until you call this command again to retrieve
data from a new query.
DBGetDataByColName -- Returns a string containing the data in the row and
column that you specify. This command allows you
to retrieve the data from the column by name.
DBGetDataByColNum -- Returns a string containing the data in the row and
column that you specify. This command allows you
to retrieve the data from the column by number.
DBError -- Returns a string with the complete text of the current error. Be very
careful that you don't call any other DBConn commands before you
retrieve the error text of the last detected error, or you may end up
with a secondary error message and miss the first one.
DBGetBool -- Returns a Boolean value (0 or 1)
DBGetByte -- Returns a Byte value (0 to 255)
DBGetWord -- Returns a Word value (0 to 65535)
DBGetDWord -- Returns a DWord value (0 to 4,294,967,295)
DBGetInt16 -- Returns a 16 bit Integer value (-32768 to 32,767)
DBGetInt32 -- Returns a 32 bit Integer value (-2,147,483,648 to 2,147,483,647)
DBGetInt64 -- Returns a 64 bit Integer value (-9,223,372,036,854,775,808 to 9,223,372,036,854,775,807)
DBGetFloat -- Returns a Floating Point value
DBGetDouble -- Returns a Double Floating Point value
DBGetString -- Returns a String value
Now available for download DBConn_1_1_5.zip.
Release Notes:
1.0.0 - Initial Release
1.0.15 - Fixed : Dataset was not being reset properly, so any data retrieved after the first SELECT would end up in the wrong position within the dataset.
1.1.4 - Added : 10 new commands to pull specific types of data from your database without having to convert them from a string.
1.1.5 - Fixed : Bug in the DBExecute command always returned 1 when successful, instead of the number of rows affected by the command.
DBConn is an ODBC Database Plugin for DarkBASIC Professional written in C# 2008 .Net and converted using ZKat8It's .Net DLL Converter which can be found at http://www.virtualdarkarts.com.
DBConn is designed to allow you to access any database file, system, or server that has an ODBC compliant driver. It has been tested with Microsoft SQL Server, MySQL Server using the MySQL ODBC Driver v3.51, and with a Microsoft Access 2000 mdb file.
When you first use DBConn, you must use the DBConnect command first. This sets the connection string to your database, opens the connection, verifies that it worked, and returns a result code letting you know whether it connected or not. If it did connect, then that connection remains open until one of 3 things happens. 1. The connection times out on it's own, and the ODBC driver closes it. 2. You close it by ending your program. 3. You use the DBConnect command again, in which case it will close the current connection and open a new connection with the connection string you supply.
While the connection is open, DBConn will let you use the other commands to access your data without having to re-open the database every time. If the connection should close on it's own due to a timeout, the other commands first check to make sure the connection is open, and if it isn't, the connection is automatically re-opened, and then your command is processed. This method saves you a lot of time. You don't have to worry about the status of the connection. Just set the connection string once, and the rest is all handled for you. The connection drops when it's not in use, but stays open during periods of frequent usage.
Due to this feature, it is not recommended to use this DLL for a client/server application where multiple clients will be accessing the database server, as you might run out of available connections on the database server.
DBConnect -- Connects to the database and sets the connection string
DBExecute -- Executes a NON-QUERY SQL statement on your database
These would be commands that don't return a dataset, such
as INSERT or DELETE.
DBRunSQL -- Executes a QUERY SQL statement on your database. This
command returns the number of rows that it has retrieved
from your query, and has stored those results in a persistent
dataset for you to retrieve your data from. The data remains
in the dataset until you call this command again to retrieve
data from a new query.
DBGetDataByColName -- Returns a string containing the data in the row and
column that you specify. This command allows you
to retrieve the data from the column by name.
DBGetDataByColNum -- Returns a string containing the data in the row and
column that you specify. This command allows you
to retrieve the data from the column by number.
DBError -- Returns a string with the complete text of the current error. Be very
careful that you don't call any other DBConn commands before you
retrieve the error text of the last detected error, or you may end up
with a secondary error message and miss the first one.
DBGetBool -- Returns a Boolean value (0 or 1)
DBGetByte -- Returns a Byte value (0 to 255)
DBGetWord -- Returns a Word value (0 to 65535)
DBGetDWord -- Returns a DWord value (0 to 4,294,967,295)
DBGetInt16 -- Returns a 16 bit Integer value (-32768 to 32,767)
DBGetInt32 -- Returns a 32 bit Integer value (-2,147,483,648 to 2,147,483,647)
DBGetInt64 -- Returns a 64 bit Integer value (-9,223,372,036,854,775,808 to 9,223,372,036,854,775,807)
DBGetFloat -- Returns a Floating Point value
DBGetDouble -- Returns a Double Floating Point value
DBGetString -- Returns a String value