Hi,
I have an unexpected result when I run a Query in SQL with ADO.
When I run oQry = oSQL:execute("SELECT * FROM klanten")
Then I can do
FOR i = 0 to len(oqry:Fields())
?oQry:Fields(i):value
NEXT i
but when I run oQry = oSQL:execute("SELECT NAAM FROM klanten")
Then I get an error because Fields(1) doesn't exist
I thought that Fields(1) now was holding the info of the first field in the query. It seems that that is the first field in tha table.
I can get the information with oQry:Fields("NAAM"):value
I have create a subroutine that give me the result of a query in a database, but it doesn'n work when not all the fields are requested.
How can I know the fieldnames retured by a query? That's why I was using oQry:Fields(i):value instead of the name.
With Qry:Fields(i):name I know the name.