cursor.UpdateRecord
Karl Grob
kgrob at mus.ch
Thu Apr 19 09:14:41 CDT 2007
Dear Ruslan
I do have a similar problem.
The Database is a very simple One-Table-Database and i work in
Classes-Way (no Server) in RB2007R2 (Val 2.9)
The update-Procedure does not work at all, the Programm quits without
error etc. There is no proper Cursor (=VCursor) but the code is
similar to V4RBRef-page69
Example:
...
rTbl = myDB.myReg (Table of DB)
EF_ = Editfields
rTbl.RecID = val(ST_Rid.Text) -> this is a existing RecId of the
Table "rTbl"
if Trim(EF_Titel.Text) > "" and Trim(EF_Zeile_1.Text) > "" then
MsgBox " Titel und 1. Zeile können nicht gleichzeitig
aktualisiert werden"
else
if Trim(EF_Titel.Text) > "" then
rTbl.Eintrag.value = EF_Titel.Text
rTbl.istTitel.value = True
else
rTbl.Eintrag.value = EF_Zeile_1.Text
rTbl.istTitel.value = False
end if
end
.....
rTbl.TxtNr.value = EF_Text_Nr.Text
rTbl.fldFrank.value = EF_Frank.Text
rTbl.ReplEintrag.value = makeReplaceEintrag(rTbl.Eintrag.GetString)
rTbl.SortEintrag.value = makeSortEintrag(rTbl.Eintrag.GetString)
rTbl.UpdateRecord -> -> Program quits
rTbl.Flush
BTW: rTbl.addRecord works in a very similar Procedure (but adding
instead of updating) without problems.
Thanks
Karl Grob
Am 17.04.2007 um 07:36 schrieb Ruslan Zasukhin:
> On 17/4/07 2:47 AM, "Bill Mounce" <BillMounce at Comcast.net> wrote:
>
>> I have found out a little more about the cursor.Update not working.
>> As it turns out, I can't update any data from within code now. I can
>> from Studio, but from code the information is lost. The strange thing
>> is that if I change the data, update, and re-search for the same
>> data, I see the changed information. However, if I quit my app and
>> come back, the data is not changed. Here is my code. Is there any
>> other information I can check for?
>>
>> I even cloned the database and ran all the checks and it is okay.
>>
>> mInflected is the database
>> curInflected is the cursor I am trying to update.
>>
>> Bill
>>
>>
>> if mInflected.IsOpen = false then
>> msgbox "You must have the inflected database open first."
>> return
>> end if
>>
>> if mInflected.IsReadOnly = true then
>> msgbox "The database is read only."
>> return
>> end if
>>
>> if curInflected.IsReadOnly then
>> msgbox "Cursor is read only"
>> return
>> end if
>>
>> if curInflected = nil then
>> msgbox "The cursor is not available."
>> return
>> end if
>>
>> collectPanes // Read data from panes to the fields of
>> the table
>>
>> try
>> curInflected.UpdateRecord
>> catch err as VException
>> msgbox "There was an error saving this update."
>> end
>
> 1) please show HOW you have create this cursor.
> and SQL also
>
> 2) just send us your project that reproduce problem.
> you can make easy with 10 lines OTHER small project
> and one button which open your db, make cursor and do this update.
>
> --
> Best regards,
>
> Ruslan Zasukhin
> VP Engineering and New Technology
> Paradigma Software, Inc
>
> Valentina - Joining Worlds of Information
> http://www.paradigmasoft.com
>
> [I feel the need: the need for speed]
>
>
> _______________________________________________
> Valentina mailing list
> Valentina at lists.macserve.net
> http://lists.macserve.net/mailman/listinfo/valentina
More information about the Valentina
mailing list