Re: Problem with Update via Client Access ODBC/ADO if record contains a negative value
- From: "R. Lowke" <rolf_at_work@xxxxxxxx>
- Date: Sun, 16 Jul 2006 04:26:50 GMT
Thanks, but that's not the reason. I get records, I can read the data in the
recordset and I can update rows/records that don't contain negative values.
I just get this error if I try to update a row/record that contains negative
values and I can read this record, too (until I try to update it).
"Drew Dekreon" <drew_dekreonATchugachelectricDOTcom> schrieb im Newsbeitrag
news:10ji17agt0cj609@xxxxxxxxxxxxxxxxxxxxx
Just guessing, but it looks like you've opened a path but not retrievedvia
a record, so there's nothing to update.
perhaps a rec.movefirst to position the cursor and read a record?
R. Lowke wrote:
Hello,
I use an ADO recordset in Visual Basic to connect to an iSeries-table
worksODBC (Client Access ODBC Driver) and have to update some records. This
Then Ifine until I want to update a record that contains a negative value.
has aget the error message "Row cannot be located for update...". The table
value.primary key and i can update if the current record contains no negative
values. It does not matter which numeric field contains the negative
directly,I can update even rows with negative values if I use SQL (UPDATE)
Test1but that's no acceptable solution. Here is an example code snippet.
and Test2 are decimal values, if Test1 contains a negative value the
mentioned error occurs.
Set cnn = New ADODB.Connection
With cnn
.CursorLocation = adUseServer
.ConnectionString = "DSN=Test"
Call .Open
End With
Set rec = New ADODB.Recordset
With rec
.ActiveConnection = cnn
.CursorLocation = adUseServer
.LockType = adLockOptimistic
.CursorType = adOpenDynamic
.Source = "TEST.TEST"
Call rec.Open(Options:=adCmdTable)
If .State = adStateOpen Then
Do While Not rec.EOF
rec!Test2 = 42
Call rec.Update
Call rec.MoveNext
DoEvents
Loop
End If
End With
Can anyone help me, please!?
.
- Prev by Date: Re: Open Ftp on AS/400
- Next by Date: Re: as/400 model 720 to an i820?
- Previous by thread: CCSIDs (again)
- Next by thread: Re: as/400 model 720 to an i820?
- Index(es):
Relevant Pages
|