Hi Marc,
there were many changes in this area :-( Could you please try if this
crash also occurs in a newer version like 1.1.17 ?
And you marco is okay, perhaps you could change the line
while NOT(oRowSet.IsLast())
oRowSet.next()
to
while oOrowSet.next()
because the rowset is always before the first row when executing the first time.
I don't see the code but the updateXxxx() method starts with column 1,
the method is not 0 based. Just for the case. :-)
Best regards,
Ocke
Marc Santhoff wrote:
Hi,
I'm trying to update a bunch of records from BASIC code:
oRowset = createUnoService("com.sun.star.sdb.RowSet")
oRowSet.DataSourceName = sDBName
oRowSet.User = "marc"
oRowSet.Password = "****"
oRowSet.ResultSetConcurrency =
com.sun.star.sdbc.ResultSetConcurrency.UPDATABLE
'
if update then
oRowSet.CommandType = com.sun.star.sdb.CommandType.COMMAND
oRowSet.EscapeProcessing = FALSE ' native SQL, ggf. ausschalten!
' Feldnamen aufbereiten
...
' Schlüssel extrahieren
...
oRowSet.Command = sSQL
oRowSet.execute()
oColumns = oRowSet.getColumns()
' über alle Reihen bzw. Elemente der Ergebnismenge
while NOT(oRowSet.IsLast())
oRowSet.next()
' Werte neu setzen
for n=0 to columncount-1
... here the updateXxxx() methods are used to set the new values
next
' wegschreiben
oRowSet.updateRow()
wend
...
The last instruction "oRowSet.updateRow()" crashes on the first call.
Tested on OOo1.1.0/FreeBSD and OOo1.1.1/Win98. The same sequence works
perfectly well if "moveToInsertRow" and "insertRwo()" are used.
My questions:
- Is there anything worng in the function sequence?
- Has a bug in this area been fixed in OOo1.1.3...1.1.5?
TIA,
Marc
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
--
Example isn't another way to teach,
it is the only way to teach.
Albert Einstein
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]