[Gambas-user] Enumerating values in sqllite3 database tables
Fabien Bodard
gambas.fr at ...626...
Wed Sep 17 13:28:52 CEST 2008
2008/9/17 MaxVK <maximvonk at ...626...>:
>
> Hi there. I am making a personal program to catalog a large collection of
> photographs and rather than install MySQL just for this purpose I would like
> to use sqlite3.
>
> Using the example program I am able to create the database and the tables
> within it, and I am (apparently) able to add data to the tables. However I
> have been unable to work out how to list the items that have been added to
> the tables.
>
> For example I have created Table1 with a field called Field1. I have then
> added several items of data (The path and file names of images) to Field1
> using code from the example:
>
> $hConn.Begin
> rTest = $hConn.Create("Table1")
> rTest!Field1 = tFilename
> rTest.Update
>
> So far, so good, but how can I get a list of the items in Field1 so that
> they can be displayed in a listbox?
>
> Any pointers would be much appreciated.
>
> regards
>
> Max
> --
dim hresult as result
hresult = db.find("Table1", "Field1")
For each hresult
ListBox.add(hResult!Field1)
next
Simply like that !!
regards,
Fabien Bodard
More information about the User
mailing list