dutch wrote:Dear All,
I try to move to MySql with xBrowse but I cannot fine absolutely simple example in the group.
Can anyone show an example to use xBrowse MySql via TDolphin or TMySql.
Like
Code: Select all
@ 0, 0 XBROWSE COLUMNS oQry:Field1, oQry:Field2 ;
HEADERS 'Field1 Header', 'Field2 Header' ;
DATASOURCE oQry ;
....
I can make from XBROWSER( oQry ) but it is not user define columns.
Thanks in advance,
Just the same way as you write code for DBF or ADO RecordSet.
Code: Select all
oQry := oSrv:Query( "SELECT * FROM CUSTOMER" )
@ 0,0 XBROWSE oBrw OF oWnd DATASOURCE oQry ;
COLUMNS "First", "Last", "Salary" ;
HEADERS "FirstName", "SurName", "Salary" <otherclauses>
If anyone knows how to code xbrowse for DBF, he already knows coding for any other datasource, be it TDataBase, ADO RecordSet, TMySql or TDolphin or any other.
Exactly the same code works for all. Only difference is the value for the clause DATASOURCE.
For example, in this statement:
Code: Select all
@ 0,0 XBROWSE oBrw OF oWnd DATASOURCE uVar ;
COLUMNS "First", "Last", "City", "Salary" <otherclauses>
if uVar is caharacter variable and is an alias name, it is DBF browse.
If uvar is an object and a recordset, it is ADO browse
If uvar is an object and TMySql/TDolphin Query, then it is TMySql/TDolphin Query
If uVar is an object and TDatabase class, it is TDatabase browse.
If uvar is an object and is oTree it is tree browse.
If uvar is an object and has Ado properties, it is properties browse.
If uvar is any other object, it browses the datas of the object.