on 04-08-2006 3:43 PM
Hi !
I have a RS.DOQUERY that returns about +/- 50 rows. I would like to put the data in my table row by row. I use this
Do While Not RS.EOF
Inv = RS.Fields.Item("RSDOC").Value
Bp = RS.Fields.Item("RSCRD").Value
Dte = RS.Fields.Item("RSDATE").Value
Styl = RS.Fields.Item("RSITM").Value
RS.DOQUERY ("INSERT INTO [@TABLE] .......")
RS.MOVENEXT()
LOOP
When i run my code it gives me the error Invalid Row..
Thanks !!
Alain
Hi Alain
What i spot here is that you use RS as a recordset, before your "while" you must of called it with your +-50 records. Thats good. But then in your loop i see you have another query to insert values, but this will then clear your +-50 records and then when you say rs.movenext it will give that error because the last query (insert query) did not return any results. Rather use a seperate Recordset for the query that return results and another for inserting Alain.
That should solve the problem.
PS: SAP prefers us using there objects to insert into a table instead of using a Query inside a recordset.But this will work!
Hope this helps
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thanks i'll try to work it out... now i get 50 times the same row in the table so i must be doing something wrong with my second recordset.
Anyway i would prefer to do it like sap recommends... would that be with datasource ? is there a sample in sdk that is close to what i'm trying to do ..
Thanks
p.s: Again i cant allow you points.. !!! i am logged in correctly and i can post. I dont understand why i cant allow you points..
p.s.2: Hey guess what i have 10 points now. I solved someones problem with DTW !!!! lets celebrate hahaha !
Alain
User | Count |
---|---|
97 | |
11 | |
11 | |
6 | |
6 | |
4 | |
4 | |
3 | |
3 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.