<<< Update Links to current web site structure >>>
DBConn Offical Page
DBConn_1_0_0.zip - Initial release.
DBConn_1_0_15.zip - Fixed : Bug that didn't clear the dataset pointer between SQL queries, so any query after the first one would be placed in the wrong position within the dataset.
DBConn_1_1_4.zip - Added : 10 new commands to pull specific data from your database without having to convert them from a string.
DBConn_1_1_5.zip - Fixed : Bug in the DBExecute command that always returned a 1 when successful, instead of the number of rows affected by the command.
DBConn is an ODBC Database plugin for DBPro. Installation is as simple as unzipping the attached file to your DBPro folder. Help files, Keyword file, the DLL, and a sample project are all there in the appropriate directories.
What this plugin lets you do is connect to darn near any data source. Any database, or datafile that has an ODBC Compliant driver should work. It's been tested with MS SQL Server 2000, MySQL Server, and an MS Access file.
DSNs: You'll need to set up a System DSN on the machine this runs on to access database servers. No DSN is needed for MS Access files. Windows has a generic entry in the User DSNs that takes care of that.
The commands available are,
DBConnect(connection string)
This sets the connection string and establishes the connection to the datasource. This command must be called before any other commands can be used. Once this command is called the connection will remain open until it times out. This allows you to run multiple commands on your database without the performance hit of having to open and close the connection after each command.
DBExecute(non-query sql statement)
This processes a non-query sql statement and returns a status code indicating the outcome. 0 = No rows were affected by the query, > 0 = The number of rows affected, -1 = An error occured.
DBRunSQL(sql statement)
This processes a standard query sql statement and returns a status code indicating the outcome. 0 = No rows were found matching your query, > 0 = The number of rows found to match your query, -1 = An error occured. The results from your query are stored in a persistent ResultSet that remains until you send another query, or close down your program.
DBGetDataByColName(row, column name)
This lets you retrieve data from the ResultSet that holds the results of your last query. In this case, you specify the row by it's index number in the ResultSet, and by Column Name. The data returned is always a string, so if a numeric value was expected you'll have to convert it.
DBGetDataByColNum(row, column)
This lets you retrieve data from the ResultSet that holds the results of your last query. In this case, you specify the row and column by their index numbers in the ResultSet. The data returned is also always in a string.
DBError()
This returns a string containing the full text of the error detected. Use this when one of the other commands returns a -1 condition to find out what the error is.
NEW Commands as of version 1.1.4
DBGetBool()
Returns a boolean value 0 or 1.
DBGetByte()
Returns a byte value from 0 to 255.
DBGetWord()
Returns a word value from 0 to 65535.
DBGetDWord()
Returns a dword value from 0 to 4,294,967,295.
DBGetFloat()
Returns a float value.
DBGetDouble()
Returns a double float value.
DBGetInt16()
Returns a 16 bit integer value from -32,768 to 32,767.
DBGetInt32()
Returns a 32 bit integer value from -2,147,483,648 to 2,147,483,647.
DBGetInt64()
Returns a 64 bit (double) integer value from -9,223,372,036,854,775,808 to 9,223,372,036,854,775,807.
DBGetString()
Returns a string.
NOTE: All row and column indexes start at 0.
If there are any other commands you would like to see, let me know. I'm always open to suggestions.
This plugin is FREE to use in personal and commercial programs.