Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsFormsForms ProgrammingQueriesModules / DAO / VBAReports / PrintingMacrosDatabase DesignSecurityConversionImporting / LinkingSQL Server / ADPMultiuser / NetworkingReplicationSetup / ConfigurationDeveloper ToolkitsActiveX ControlsNew UsersGeneral 1General 2
Access DirectoryToolsTutorialsUser Groups
Related Topics
SQL ServerOther DB ProductsMS OfficeMore Topics ...

MS Access Forum / Modules / DAO / VBA / September 2006

Tip: Looking for answers? Try searching our database.

ADO print all fields in recordset

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
BillyRogers - 25 Sep 2006 22:29 GMT
I have 80 fields in a recordset and need to print them all.  Is there an
easier was to do it than this?

Is there some sort of command that where you say something like

debug.print      rs2.allFields  ????

Do Until Rs3.EOF
           Debug.Print Rs3.Fields(0) & "; " & Rs3.Fields(1) & "; " &
Rs3.Fields(2) & "; " & Rs3.Fields(3) & " ;" & Rs3.Fields(4) & " ;" &
Rs3.Fields(5) & "; " & Rs3.Fields(6) & "; " & Rs3.Fields(7) & " ;" &
Rs3.Fields(8) & "; " & Rs3.Fields(9) & " ;" & Rs3.Fields(10) & " ;" &
Rs3.Fields(11) & " ;" & Rs3.Fields(12) & "; " & Rs3.Fields(13) & "; " &
Rs3.Fields(14) & "; " & Rs3.Fields(15) & "; " & Rs3.Fields(16) & "; " &
Rs3.Fields(17) & "; " & Rs3.Fields(18) & " ;" & Rs3.Fields(19) & "; " &
Rs3.Fields(20) & "; " & Rs3.Fields(21) & "; " & Rs3.Fields(22) & "; " &
Rs3.Fields(23) & "; " & Rs3.Fields(24) & " ;" & Rs3.Fields(25) & "; " &
Rs3.Fields(26) & " ;" & Rs3.Fields(27) & " ;" & Rs3.Fields(28) & "; " &
Rs3.Fields(29) & "; " & Rs3.Fields(30) & "; " & Rs3.Fields(31) & "; " &
Rs3.Fields(32) & "; " & Rs3.Fields(33) & "; " & Rs3.Fields(34) & "; " &
Rs3.Fields(35) & "; " & Rs3.Fields(36) & "; " & Rs3.Fields(37) & "; " &
Rs3.Fields(38) & "; " & Rs3.Fields(39) & "; " & Rs3.Fields(40) _
           & "; " & Rs3.Fields(41) & "; " & Rs3.Fields(42) & "; " &
Rs3.Fields(43) & " ;" & Rs3.Fields(44) & " ;" & Rs3.Fields(45) & "; " &
Rs3.Fields(46) & "; " & Rs3.Fields(47) & " ;" & Rs3.Fields(48) & "; " &
Rs3.Fields(49) & " ;" & Rs3.Fields(50) & " ;" & Rs3.Fields(51) & " ;" &
Rs3.Fields(52) & "; " & Rs3.Fields(53) & "; " & Rs3.Fields(54) & "; " &
Rs3.Fields(55) & "; " & Rs3.Fields(56) & "; " & Rs3.Fields(57) & "; " &
Rs3.Fields(58) & " ;" & Rs3.Fields(59) & "; " & Rs3.Fields(60) & "; " &
Rs3.Fields(61) & "; " & Rs3.Fields(62) & "; " & Rs3.Fields(63) & "; " &
Rs3.Fields(64) & " ;" & Rs3.Fields(65) & "; " & Rs3.Fields(66) & " ;" &
Rs3.Fields(67) & " ;" & Rs3.Fields(68) & "; " & Rs3.Fields(69) & "; " &
Rs3.Fields(70) & "; " & Rs3.Fields(71) & "; " & Rs3.Fields(72) & "; " &
Rs3.Fields(73) & "; " & Rs3.Fields(74) & "; " & Rs3.Fields(75) & "; " &
Rs3.Fields(76) & "; " & Rs3.Fields(77) & "; " & Rs3.Fields(78) & "; " &
Rs3.Fields(79)
           
           
           Rs3.MoveNext
       

Signature

Billy Rogers

Dallas,TX

Currently Using Office 2000  and Office 2003

Douglas J. Steele - 25 Sep 2006 22:41 GMT
Sorry, there's no such command. However, since the semi-colon positions the
insertion point immediately following the last character displayed, you
should be able to use:

Dim intLoop As Integer

 For intLoop = 0 To Rs3.Fields.Count - 2
   Debug.Print Rs3.Fields(intLoop)  & "; " ;
 Next intLoop
 Debug.Print Rs3.Fields(Rs3.Fields.Count - 1)

Signature

Doug Steele, Microsoft Access MVP
http://I.Am/DougSteele
(no private e-mails, please)

>I have 80 fields in a recordset and need to print them all.  Is there an
> easier was to do it than this?
[quoted text clipped - 34 lines]
>
>            Rs3.MoveNext
BillyRogers - 25 Sep 2006 22:57 GMT
Do you think either method makes a difference in the speed of execution?
Signature

Billy Rogers

Dallas,TX

Currently Using Office 2000  and Office 2003

> Sorry, there's no such command. However, since the semi-colon positions the
> insertion point immediately following the last character displayed, you
[quoted text clipped - 45 lines]
> >
> >            Rs3.MoveNext
Douglas J. Steele - 26 Sep 2006 13:08 GMT
I doubt it. Speed of execution when you're dumping 80 fields to the
immediate window doesn't seem that relevant to me anyhow.

Signature

Doug Steele, Microsoft Access MVP
http://I.Am/DougSteele
(no e-mails, please!)

> Do you think either method makes a difference in the speed of execution?
>
[quoted text clipped - 48 lines]
>> >
>> >            Rs3.MoveNext
RoyVidar - 25 Sep 2006 22:51 GMT
"BillyRogers" <BillyRogers@discussions.microsoft.com> wrote in message
<614E3CC2-0D50-4657-8333-1262017ADA32@microsoft.com>:
> I have 80 fields in a recordset and need to print them all.  Is there
> an  easier was to do it than this?
[quoted text clipped - 37 lines]
>            
>             Rs3.MoveNext

Try

Debug.print rs.getstring(adclipstring, , "; ")

Signature

Roy-Vidar

BillyRogers - 26 Sep 2006 14:12 GMT
Thanks Roy-Vidar.  That's exactly what I was looking for.   It's very useful.
Signature

Billy Rogers

Dallas,TX

Currently Using Office 2000  and Office 2003

> "BillyRogers" <BillyRogers@discussions.microsoft.com> wrote in message
> <614E3CC2-0D50-4657-8333-1262017ADA32@microsoft.com>:
[quoted text clipped - 43 lines]
>
> Debug.print rs.getstring(adclipstring, , "; ")
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.