Sign Up |  Live StatsLive Stats    Articles 35,345| Comments 159,790| Members 17,820, Newest waheguruhelpme| Online 239
Home Contact
 (Forgotten?): 
    Sikhism

   
                                                                     Your Banner Here!    

Sikh Philosophy Network » Sikh Philosophy Network » Current Affairs » Information Technology » Solution: RecordSet always returns 1 record...SQL says otherwise!

Solution: RecordSet always returns 1 record...SQL says otherwise!

Our Donation Goal : Why Donate? : Donate Today! : Donate Anonymously (ਗੁਪਤ) : Our Family of Supporters
Goal this month: 400 USD, Received: 35 USD (9%)
Please Donate...
Related Topics...
Thread Thread Starter Forum Replies Last Post
Adding to a recordset James Information Technology 2 28-Jul-2006 08:42 AM
SQL Recordset criteria with a * Hindsey Information Technology 2 28-Jul-2006 08:37 AM
Recordset.EOF not working Adam Thwaites Information Technology 5 28-Jul-2006 08:33 AM
Put a watch on a recordset ?? SpookiePower Information Technology 3 28-Jul-2006 08:03 AM
Can't Create Recordset BenL712 Information Technology 1 03-Nov-2005 11:35 AM


Tags
solution, recordset, always, returns, recordsql, says, otherwise
Reply Post New Topic In This Forum Stay Connected to Sikhism, Click Here to Register Now!
  #1 (permalink)  
Old 28-Jul-2006, 08:25 AM
Simon Harris's Avatar Simon Harris
Guest
 
Posts: n/a
   
   
Solution: RecordSet always returns 1 record...SQL says otherwise!

  Donate Today!   Email to Friend  Tell a Friend   Show Printable Version  Print   Contact sikhphilosophy.net Administraion for any Suggestions, Ideas, Feedback.  Feedback  

Register to Remove Advertisements
Hi All,

I've just spent 3 hours working on getting a simple recordset loop to go
through all the records that the SQL returned.

Heres my code, commented with how I eventually fixed it:

Dim conn As DAO.Database
Set RSCheckCurrentReadings = conn.OpenRecordset(strSQL)

RSCheckCurrentReadings.MoveFirst <<< Without these two lines, the
recordset loop only returned 1 record
RSCheckCurrentReadings.MoveLast <<<
Do While Not RSCheckCurrentReadings.EOF
MsgBox (CInt(RSCheckCurrentReadings("idInvoice")))
Loop

Hopefully that will be helpful to someone in the future, took me a lot of
Googling to work it out.

Thanks to Graham Mandeno and John Vinson for giving me some very useful
pointers in solving this.
Reference:: Sikh Philosophy Network http://www.sikhphilosophy.net/information-technology/11963-solution-recordset-always-returns-1-record.html
http://groups.google.co.uk/group/mic...b0de72b12ed5fc

But...I still dont understand why I need to movelast AND movefirst. (Move
first before a loop I can understand).
Reference:: Sikh Philosophy Network http://www.sikhphilosophy.net/showthread.php?t=11963

Cheers all!
Simon.

--
-
* Please reply to group for the benefit of all
* Found the answer to your own question? Post it!
* Get a useful reply to one of your posts?...post an answer to another one
* Search first, post later : http://www.google.co.uk/groups
* Want my email address? Ask me in a post...Cos2MuchSpamMakesUFat!







 
Do share your immediate thoughts or reactions on this issue? We value your views! Login Now! or Sign Up Today! to share your views with us.. Gurfateh!
Reply With Quote
Sponsored Links
  #2 (permalink)  
Old 28-Jul-2006, 08:25 AM
Douglas J Steele's Avatar Douglas J Steele
Guest
 
Posts: n/a
   
   
Re: Solution: RecordSet always returns 1 record...SQL says otherwise!

Actually, only the MoveLast should be required.

As well, your code as presented is going to constantly pop up the message
box.

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


"Simon Harris" wrote in message
news:e52gW1rlGHA.3632@TK2MSFTNGP03.phx.gbl...
> Hi All,
>
> I've just spent 3 hours working on getting a simple recordset loop to go
> through all the records that the SQL returned.
>
> Heres my code, commented with how I eventually fixed it:
>
> Dim conn As DAO.Database
> Set RSCheckCurrentReadings = conn.OpenRecordset(strSQL)
Reference:: Sikh Philosophy Network http://www.sikhphilosophy.net/showthread.php?t=11963
>
> RSCheckCurrentReadings.MoveFirst <<< Without these two lines, the
> recordset loop only returned 1 record
> RSCheckCurrentReadings.MoveLast <<<
> Do While Not RSCheckCurrentReadings.EOF
> MsgBox (CInt(RSCheckCurrentReadings("idInvoice")))
> Loop
>
> Hopefully that will be helpful to someone in the future, took me a lot of
> Googling to work it out.
>
> Thanks to Graham Mandeno and John Vinson for giving me some very useful
> pointers in solving this.
>

http://groups.google.co.uk/group/mic...b0de72b12ed5fc
>
> But...I still dont understand why I need to movelast AND movefirst. (Move
> first before a loop I can understand).
>
> Cheers all!
> Simon.
>
> --
> -
> * Please reply to group for the benefit of all
> * Found the answer to your own question? Post it!
> * Get a useful reply to one of your posts?...post an answer to another one
> * Search first, post later : http://www.google.co.uk/groups
Reference:: Sikh Philosophy Network http://www.sikhphilosophy.net/showthread.php?t=11963
> * Want my email address? Ask me in a post...Cos2MuchSpamMakesUFat!
>
>



Reply With Quote
  #3 (permalink)  
Old 28-Jul-2006, 08:25 AM
Sylvain Lafontaine's Avatar Sylvain Lafontaine
Guest
 
Posts: n/a
   
   
Re: Solution: RecordSet always returns 1 record...SQL says otherwise!

  Donate Today!  
Unless you want the total count number of rows, making a MoveLast followed
by a MoveFirst should be useless in your case and doing a MoveFirst right
after the OpenRecordset should always be useless.

You don't give us neither the value of strSQL nor the description of the
table(s); so it's hard to tell you why you have hitting this strange bug.
BTW, you don't even give us the value of the ID returned when you have the
bug.

--
Sylvain Lafontaine, ing.
MVP - Technologies Virtual-PC
E-mail: http://cerbermail.com/?QugbLEWINF


"Simon Harris" wrote in message
news:e52gW1rlGHA.3632@TK2MSFTNGP03.phx.gbl...
> Hi All,
>
> I've just spent 3 hours working on getting a simple recordset loop to go
> through all the records that the SQL returned.
Reference:: Sikh Philosophy Network http://www.sikhphilosophy.net/showthread.php?t=11963
>
> Heres my code, commented with how I eventually fixed it:
>
> Dim conn As DAO.Database
> Set RSCheckCurrentReadings = conn.OpenRecordset(strSQL)
>
> RSCheckCurrentReadings.MoveFirst <<< Without these two lines, the
> recordset loop only returned 1 record
> RSCheckCurrentReadings.MoveLast <<<
> Do While Not RSCheckCurrentReadings.EOF
> MsgBox (CInt(RSCheckCurrentReadings("idInvoice")))
> Loop
>
> Hopefully that will be helpful to someone in the future, took me a lot of
> Googling to work it out.
>
> Thanks to Graham Mandeno and John Vinson for giving me some very useful
> pointers in solving this.
> http://groups.google.co.uk/group/mic...b0de72b12ed5fc
Reference:: Sikh Philosophy Network http://www.sikhphilosophy.net/showthread.php?t=11963
>
> But...I still dont understand why I need to movelast AND movefirst. (Move
> first before a loop I can understand).
>
> Cheers all!
> Simon.
>
> --
> -
> * Please reply to group for the benefit of all
> * Found the answer to your own question? Post it!
> * Get a useful reply to one of your posts?...post an answer to another one
> * Search first, post later : http://www.google.co.uk/groups
> * Want my email address? Ask me in a post...Cos2MuchSpamMakesUFat!
>



Reply With Quote
   Click Here to Donate Now!

Support Us!
Become a Promoter!
Gurfateh ji, you can become a SPN Promoter by Donating as little as $10 each month. With limited resources & high operational costs, your donations make it possible for us to deliver a quality website and spread the teachings of the Sri Guru Granth Sahib Ji, to serve & uplift humanity. Every contribution counts. Donate Generously. Gurfateh!
ReplyPost New Topic In This Forum Stay Connected to Sikhism, Click Here to Register Now!

Bookmarks


(View-All Members who have read this thread : 0
There are no names to display.

Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Tools Search
Search:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is On
Trackbacks are On
Pingbacks are On
Refbacks are On

» Gurbani Jukebox
Listen to Gurbani while surfing SPN!
» Active Discussions
sikhism Who is "Mohan"?
Today 08:46 AM
22 Replies, 331 Views
sikhism How important is Matha...
Today 08:12 AM
59 Replies, 1,037 Views
sikhism need urgent advice.......
Today 06:46 AM
6 Replies, 78 Views
sikhism ਨਾਮਾ
Today 06:37 AM
2 Replies, 51 Views
sikhism Sikh Diamonds Video...
Today 04:23 AM
6 Replies, 115 Views
sikhism Are Creator and Creation...
Today 01:30 AM
44 Replies, 2,835 Views
sikhism Herman Hesse,...
Today 00:54 AM
13 Replies, 228 Views
sikhism On a Scale of Most...
Yesterday 21:42 PM
30 Replies, 1,277 Views
sikhism I became victim by...
Yesterday 19:50 PM
0 Replies, 43 Views
sikhism Sikh Books downloads
Yesterday 15:39 PM
2 Replies, 65 Views
sikhism Salok Sheikh Farid ji...
Yesterday 09:35 AM
0 Replies, 46 Views
sikhism In Punjab, three farmers...
Yesterday 05:36 AM
0 Replies, 48 Views
sikhism Supernatural Sikhs, what...
Yesterday 03:45 AM
19 Replies, 413 Views
sikhism Sukhmani Sahib Astpadi...
26-May-2012 22:57 PM
0 Replies, 49 Views
Do You Think You Are...
26-May-2012 09:59 AM
94 Replies, 8,258 Views
» Books You Should Read...
Powered by vBadvanced CMPS v3.2.2

All times are GMT +6.5. The time now is 08:49 AM.
Powered by vBulletin® Version 3.8.6
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.5.2 Copyright © 2004-12, All Rights Reserved. Sikh Philosophy Network


Page generated in 0.39735 seconds with 30 queries