> > "Harry Strybos" <harry@no.spam.ffapaysmart.com.au> wrote in message
news:417d67e4$0$704$61c65585@uq-127creek-reader-02.brisbane.pipenetworks.com.au...
> >> > Using VB6 DAO MS Access
> >> >
[quoted text clipped - 30 lines]
> to another name. Other than that, check to make sure there is not a typo in
> your code.
Can you give me an example of how to read the fields when a querydef is
done?
Thanks,
Dag Sunde - 27 Oct 2004 07:29 GMT
> "Harry Strybos" <harry@no.spam.ffapaysmart.com.au> wrote in message
news:417eb262$0$708$61c65585@uq-127creek-reader-02.brisbane.pipenetworks.com.au...
> > > "Harry Strybos" <harry@no.spam.ffapaysmart.com.au> wrote in message
news:417d67e4$0$704$61c65585@uq-127creek-reader-02.brisbane.pipenetworks.com.au...
> > >> > Using VB6 DAO MS Access
> > >> >
[quoted text clipped - 36 lines]
> Can you give me an example of how to read the fields when a querydef is
> done?
Yes, as soon as you send us the *excact* names of the Queries, Column- and
tablenames as they are defined in Access.
While I'm at it: Never use special characters like "#" and its like in
table- or column names! Avoid spaces too! It's asking for trouble!
Upper and lower case a-z plus the underscore ensures you legal, portable
database-defs (as long as you avoid the db's reserved words).

Signature
Dag.
Jason Keats - 27 Oct 2004 14:29 GMT
> Can you give me an example of how to read the fields when a querydef
> is done?
This will display the fields returned by your query...
Dim i As Integer
If Not (rs Is Nothing) Then
If rs.Fields.Count > 0 Then
For i = 0 To rs.Fields.Count - 1
Debug.Print i, rs.Fields(i).Name
Next i
End If
End If
jt - 28 Oct 2004 05:25 GMT
> > Can you give me an example of how to read the fields when a querydef
> > is done?
[quoted text clipped - 10 lines]
> End If
> End If
How you would read the values in those fields?
Thanks,
jt
Jason Keats - 28 Oct 2004 14:15 GMT
>>> Can you give me an example of how to read the fields when a querydef
>>> is done?
[quoted text clipped - 15 lines]
> Thanks,
> jt
To display all data in a recordset, you could use something like:
Dim i As Integer
If Not (rs Is Nothing) Then
With rs
If .BOF And .EOF Then
'no records returned
Else
'.MoveFirst
Do Until .EOF
For i = 0 To .Fields.Count - 1
Debug.Print .Fields(i).Name & " : " & .Fields(i).Value
Next i
Debug.Print
.MoveNext
Loop
End If
End With
End If
HTH
jt - 31 Oct 2004 18:12 GMT
> >>> Can you give me an example of how to read the fields when a querydef
> >>> is done?
[quoted text clipped - 38 lines]
>
> HTH
Thanks! Your example helped out alot on reading the field values.
jt