|
-
Dec 13th, 2004, 10:45 PM
#1
Thread Starter
Lively Member
Distinct value...pls help
Hi
How can I retrieve the next value from distinct using the code below?
*********************************************************
Qry = "Select distinct size from parttb Where id = '" & txtItem.List(i) & "' "
Set RawSql = New ADODB.Recordset
RawSql.CursorLocation = adUseClient
RawSql.Open Qry, S_GateDb, adOpenDynamic, adLockPessimistic
Size1 = RawSql(0)
//How to get size2 and so on
*********************************************************
Kindly enlightened me. Thanks alot
-
Dec 13th, 2004, 10:52 PM
#2
Re: Distinct value...pls help
You need to navigate through the recordset by calling MoveNext (Previous, First, Last) method(s):
Code:
RawSql.MoveNext
If RawSql.EOF THen RawSql.MoveLast
-
Dec 14th, 2004, 12:28 AM
#3
Lively Member
Re: Distinct value...pls help
Use this
VB Code:
while Rset.EOF = False
....
RSET.MoveNext
wend
Jobs: "Do u want to sell colored sugar water or change the world?"
Get Firefox Now!!!
Mendhak leaving town. 
-
Dec 14th, 2004, 01:04 AM
#4
Hyperactive Member
Re: Distinct value...pls help
Try This
First of all count total records in recordset
then declare an arry subject to totalrecords
start do while loop till eof
move size from table to array
do while Rset.Eof = False
size[1] = Rset!size
Rset.MoveNext
Loop
-
Dec 14th, 2004, 02:42 AM
#5
Thread Starter
Lively Member
Resolved: Distinct value...pls help
Thanks a lot...
I solved it using Do Loop.. then RawSql.MoveNext
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|