[Gambas-user] Enumerating values in sqllite3 database tables
MaxVK
maximvonk at ...626...
Wed Sep 17 13:59:35 CEST 2008
Fabien Bodard-4 wrote:
>
> 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
>
Hmm. Thanks Fabien - That looks simpler but Ill be needing to use the SQL to
get my results, which will be based on tags. The objective is to add all my
images to one table, but to separate them by associating tags with each
image.
Regards
Max
--
View this message in context: http://www.nabble.com/Enumerating-values-in-sqllite3-database-tables-tp19529262p19530488.html
Sent from the gambas-user mailing list archive at Nabble.com.
More information about the User
mailing list