Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Error in assigning string value to recorset field

Status
Not open for further replies.

PANIk

Programmer
Apr 22, 2002
7
0
0
AU
Basiaclly I have this code that opens a stored procedure

Set mUsersRecordset = New ADODB.Recordset

With mUsersRecordset
.CursorLocation = adUseClient
.CursorType = adOpenDynamic
.LockType = adLockBatchOptimistic
.Open "Maintenance_Select_Users", Create_Connection, , , adCmdStoredProc
End With

Then I try to do this, when i either do an AddNew Or a Find to get a specific record

mUsersRecordset!User_Name = txtUserID.Text

And I get the following error

Run-time error '-2147217887 (80040e21)'
Multiple-step operation generated errors. Check each status value.

How do I check theses status. Thanx for your time
 
This applies to default values. My database design does not have default values. I can't use a server side cursor because a lot off adding and updating is done on the client side and then its batch updated. I don't think a server side cursor is wise.

It is giving me error with char fields not datetime.

I don't think that it still helps??

Thanx for the reply
 
You try this, I think this will help you

you change the lock type to adLockOptimistic
then compare the db value within a loop where you should check for not EOF that is
=================================
with rs
do while not .eof
if !user_id=txtUserId then
!name=txtname
------
------
bCheck=true 'bolean var to chk the availablity
.update
exit do
end if
.movenext
loop
end with
if not bcheck then
.addnew
!name=txtname
------
------
.update
end if

=====================
Regards,
Mathi Krishna
KEEP SMILING TODAY AND ALWAYS
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top