[Gambas-user] DataBrowser and SQL views
Benoit Minisini
gambas at ...1...
Fri Jan 18 21:10:43 CET 2008
On vendredi 18 janvier 2008, Paolo Fagni wrote:
> Hello,
>
> I'm experimenting with DataSource and DataBrowser, I can successfully use
> the DataBrowser to print rows from a table but not from a persistent view
> with SQLite.
>
> Gambas (latest version available) tells me that the table xxx doesn't exist
> when I set
>
> DataSource1.Table = "pView"
>
> Is there a way to use views with DataSource and DataBrowser? Or at least to
> use Joined tables? Since I can do a "SELECT * FROM pView" with my database
> connection it shouldn't be impossible...I guess :)
>
> By the way, what's the correct way to get data from the currently selected
> row in a DataBrowser?
>
> Thank you.
>
> Cheers,
I'm afraid there is no view support at the moment in the database component.
To get the current data of a DataBrowser, you must ask to its DataSource. For
example, if MyDataBrowser is inside MyDataSource, then you should do:
PRINT MyDataSource[FieldName]
You have method to move the cursor of the DataSource: MoveFirst, MoveLast,
MoveTo... Other methods change its editable state: Create, Save, Cancel...
Actually all these methods are called by the DataBrowser toolbar.
Regards,
--
Benoit Minisini
More information about the User
mailing list