Here is my code:
string strSyntax, strError, strSQL
datastore dsObject
long lngInsertedRow, x1
dsObject = create datastore
strSQL = 'select * from testtable'
strSyntax = sqlca.SyntaxFromSQL(strSQL, 'style(type=grid)', strError)
if strError <> '' then
messagebox('Error', strError)
else
dsObject.reset()
dsObject.Create(strSyntax, strError)
dsObject.settransobject(sqlca)
dsObject.retrieve()
end if
if dsObject.rowcount() > 0 then
lngInsertedRow = dsobject.insertrow(0)
if lngInsertedRow > 0 then
//messagebox('number', string(dsObject.getitemnumber(1, 'col1')))
//messagebox('date', string(dsObject.getitemdatetime(1, 'col2')))
//messagebox('number', string(dsObject.getitemnumber(2, 'col1')))
//messagebox('date', string(dsObject.getitemdatetime(2, 'col2')))
dsobject.setitem(lngInsertedRow, 'col1', 3)
dsobject.setitem(lngInsertedRow, 'col2', date('10/16/2003
00:00:00'))
x1 = dsObject.update() // this is where the error occurs!
end if
end if
destroy(dsObject)
you should use
dsObject = create uo_nv_datastore // where uo_nv_datastore is the
user object you have inherited from the datastore, in which you have
coded your dberror event