Assignment of a value to a Record Set Object with ADO?

Why do we get a Runtime Error (-2147467259(80004005))? The Statement is done but the MoveNext-Methode cuts off.

With rs
.ActiveConnection = frmMain.m_dbConn
.CursorLocation = adUseClient
.CursorType = adOpenStatic
.LockType = adLockOptimistic
.Source = sSQLAbr
.Open
End With

While Not rs.EOF
       
rs!VersandartenText = "hallo"
rsmerk.MoveNext
       
Wend



blackjack020900Asked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

deightonprogCommented:
'why not

While Not rs.EOF
                           
rs!VersandartenText = "hallo"
rs.MoveNext
                           
Wend




0
p_biggelaarCommented:
I'd also advice to use rs.Update so you make sure the datachanges will be committed, like

rs!VersandartenText = "hallo"
rs.Update
rs.MoveNext

cheerio
0
blackjack020900Author Commented:
I don't want to make an update, because the field doesn't exist in the database it's only located in a Record Set.
0
The Ultimate Tool Kit for Technolgy Solution Provi

Broken down into practical pointers and step-by-step instructions, the IT Service Excellence Tool Kit delivers expert advice for technology solution providers. Get your free copy for valuable how-to assets including sample agreements, checklists, flowcharts, and more!

mark2150Commented:
Well then how do you expect to assign a value to a field that doesn't exist? If you've created a transient field for a result then it's READ ONLY and you can't assign back to it.

M
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
blackjack020900Author Commented:
The field was selected with the following statement:
sSQLAbr =
" select  versandart," &_
" VersandartenText= 'xxxxxxxxxxxxx'" &_
" from auftrag"
....

This means, the field does not exist in the DB but is only generated in the SELECT statement
0
p_biggelaarCommented:
Then it should crash in the assign statement rs!vers...="Hallo", and not in the movenext!! You don't have a field called VersandartenText because:
- it doesn't exist in the db
- you didn't add it as an alias in the select statement
0
blackjack020900Author Commented:
Thanks!
It just took a while till I figured it out!
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Visual Basic Classic

From novice to tech pro — start learning today.