Unanswered: problems on writing data in a oracle db via recordset
hi everybody i have a problem
i have a programme in vb6 that gets data from a oracle database and also should write data into the database
now i get the datas with a recordset like that
GetData SQLUserData, adOpenForwardOnly, recData
'setting the recordset
Set GetData1 = New ADODB.Recordset
'execute the SQL-Query
GetData1.Open strSQL, conDB, strCursortype, adLockBatchOptimistic
Set rsOutput = GetData1
The strSQL contains the sql-query
that works so far but if i want to write data into that recordset with
recData.Fields(4) = Date
then i get this message:
"Current Recordset does not support updating. This may be a limitation of the provider, or of the selected locktype"
the code works when the used database is a access database is there a thing in oracle that i need to tell the tables that they can be editet?
does somebody know what is the problem here and how i can solve that?
thanks a real lot
Sorry, I don't know, but just a suggestion : if you only select data to update some fields, then instead of a SELECT, just execute an UPDATE query : it should be much faster especially if the select return many rows, since almost all of the work would be done on the server, and very few data would transit on the network. Now if you have to get data for other processing, then keep your select, but you could still do an update afterwards though, if you can't get your current method to work..
yes the problem is that i need the recordset with the select anyways
its also that i have this problem very often in my programme if i have to do a update too then that will be lots of extra code
but if its not working other way then i will have to use the update
how do i do that though?
just like update tablename.colum
does it work like that?
Right; you can't update an Oracle table (column) using SELECT statement; you'll have to use the UPDATE statement which, in a simple way, looks like this:
UPDATE tablename SET
column = column_value
UPDATE emp SET
ename = 'Just Me'
WHERE empno = 1234;