Hi,
I currently work on a mid-size commercial application that needs a MySQL database. I connect using the PB-internal ODBC-methods.
Here are my wishes:
After a call to DatabaseQuery(), the row-cursor should be on the first returned row. I allways have to call NextDatabaseRow() to get the first results. That is unusually.
I need a command to get the number of results! Something like DatabaseRowCount().
There should be more commands to move the row-cursor: DatabaseMoveFirstRow() and DatabaseMoveLastRow() would be verry good.
Something like DatabaseEOF() and DatabaseBOF(). If I use NextDatabaseRow() to verify the end of the results, the cursor moves if I'm not. I want to check this, without moving the cursor (like in other languages like VB using ADO EOF() and BOF()).
A way to filter the results again! Something like the Filter-Flag of ADO: Filterstring.s = "Value > 500": DatabaseFilter(Filterstring.s)
I need a direct way to reach values in a row. Something like GetDatabaseString("ColumnName") instead of heaving to know the column-number. If I query with SELECT * FROM... I really not know the right column in many cases.
I miss the possibility of selecting, if the cursor is server-side or client-side. Maybe this is possible in ODBC or do I have to select this in the User-DSN on windows?
Ok, this have been my wishes for using databases.
Kukulkan
Better database-support
I use this small procedure:I need a direct way to reach values in a row. Something like GetDatabaseString("ColumnName") instead of heaving to know the column-number. If I query with SELECT * FROM... I really not know the right column in many cases.
Code: Select all
Procedure GetDatabaseColumn(name$)
For N=0 To DatabaseColumns()
If DatabaseColumnName(N)=name$
ProcedureReturn N
EndIf
Next N
ProcedureReturn -1
EndProcedure
Tranquil
Kukulkan,
PBs database is extremely lightweight for speed and efficiency.
For readable code create constants for the column names. All of the readability but with no runtime overhead.
VB doesn't have any database support at all. It uses Microsoft's ADODB components. Purebasic can use exactly the same library.
The comlib user library includes examples of how to use ADODB.
http://www.purearea.net/pb/download/use ... B_demo.zip
PBs database is extremely lightweight for speed and efficiency.
For readable code create constants for the column names. All of the readability but with no runtime overhead.
VB doesn't have any database support at all. It uses Microsoft's ADODB components. Purebasic can use exactly the same library.
The comlib user library includes examples of how to use ADODB.
http://www.purearea.net/pb/download/use ... B_demo.zip
- the.weavster
- Addict
- Posts: 1576
- Joined: Thu Jul 03, 2003 6:53 pm
- Location: England
REALbasic Pro has a MySQL plugin that enables you to very easily create an app that works with MySQL and you end up with a cross-platform self contained *.exe which doesn't require any external resources.
You do have to set the server to use the old password algorithm as the plugin needs updating but it's easy to do.
Don't expect the *.exe to be of the tiny dimensions created by PureBasic though.
You do have to set the server to use the old password algorithm as the plugin needs updating but it's easy to do.
Don't expect the *.exe to be of the tiny dimensions created by PureBasic though.