Re: Newbie: VB-ADO help




"steve" <try@xxxxxxxx> wrote in message
news:3a9bd$4466bbfd$cf706fd3$30236@xxxxxxxxxxxx
Thanx for your time and valuable advice Ralph!

Two main comments:
1) As i said, i could have done all this in memory, but the number of
"records" (tuples) **could** be huge, so there is a chance memory will
not
be enough. The next, simplest, thing would be, I believe, a "simple" DB
table in Access.

2) I Do have some SQL knowledge and because the calculations are a bit
complicated (= complex querries) I want to avoid that road.
It would require a lot of typing to give you just one example of the types
of calculations.I'll just say this, I have to find the records that
(Date1,X,Y) satisfy specific conditions , calculate the standard
deviation,
and add it to the field StDev, in all the records that were chosen.
Repetition = bad relational design , but i dont care, i just need 1 table
for the temporary **space**. I am not attaching a DB to my project.
Its also a matter of "hard-headedness"!... :) I love the simplicity and
convinience of the solution in mind (assuming its possible!...)

Now, regarding the Autonum solution, or i can actually add a field (e.g.
MyCount ) which takes its Values from a counter and gets incremented
during
the first loop (where i fill up the values of Date1, X and Y).
After i finish , I call Order with respect to that field, as you
suggested.
Then, can I be SURE that the absolute positions would be the right ones
always ????
In other words :

rsCalculations.Sort = "MyIndex"
rsCalculations.MoveFirst

Loop 1 to 20
rsCalculations..MoveNext
End Loop

' At this point the pointer is on record with MyIndex=20 ?????

Thanx again!!
_Steve


<snipped>

Air Code

Table1
MyRun
MyCount
MyX
MyY

"INSERT INTO Table1 (MyDate, MyRun, MyCount, MyX, MyY)
VALUES ( 1, 1, 12.04, 10.23)"
....

To recover...
"SELECT MyRun, MyCount, MyX, MyY FROM Table1
WHERE MyRun = 1 ORDER BY MyCount"

Rational Database return 'bags' of stuff. You retrieve the items in the bad
depending on the instructions you provide when query for one.

To 'read' the items use a Loop (While or Do...Loop), don't depend on
RecordCount (the reliability of which is dependent on cursor type and
provider).

With rs
While Not .EOF And Not .BOF
lCnt = !MyCount
....
.MoveNext
Wend
End With

Or use GetRows() (Look it up in help)
Dim vaRun()
Dim lCount As Long
With rs
If .BOF And .EOF Then
debug.print "no records"
Else
vaRun = .GetRows()
lCount = UBound(vaRun, 2) + 1
For idx To lCount - 1
lCnt = vaRun(0,idx)
...
Next
End If
End With


hth
-ralph






.