John Newby wrote:
I would still need to know how many times to go through the while
> loop to add the names of the fields?

John,

I haven't been following this thread that closely, but (based on other wrappers I've used) I would have expected your sqlite wrapper to do one of two things:

a) let you request all results returned in an array or list
b) let you request results one at a time and raise an error or exception
   when you've run off the end.

In a) you don't need to know the number of results or allocate an array to hold them - the wrapper does it for you. If you use the right query you get what you want with no work.

In b) you start with an empty list or array and loop through the result set appending each result to the end of the list. Dictionaries solve the know-the-size-in-advance problem but aren't really appropriate as you lose the order of the fields and you have to extract the keys/names (and store them...?) before you can use them.

You only need a while loop for b) because if you know the number of items in advance a for-loop would be more appropriate. a) is the better solution here because it's less work on your part.

It's a pity you're stuck with VB - what you're trying to do is a one liner in Python with either of apsw or pysqlite and I imagine most other languages and wrappers are similar. :-/

JOOI, when is your deadline?

Martin

Reply via email to