RecordSet Update throwing invalid argument

the_louv

New member
Local time
Today, 00:17
Joined
Feb 16, 2010
Messages
4
I am modifying existing code from a previous project designed to split an oracle database. When running an existing modules I get an 'invalid argument' when it executes the myRecordSet.Update.

I have placed myRecordSet in AddWatch, and found the record it blows up on. It contains a / character. As a test I ran a delete query to delete all records containing / in that particular table, and re-ran the module. The module works as expected.

However, this does not fix my problem, as moving forward I will need this data. I can refresh the database to begin at square one, so the deleted records are easily recovered. Are there special characters that the RecordSet object's update method will have problems with, and is there a work around?
 
Can you post a larger chunk of your code?
 
Do Until rs_data.EOF
rs_data.Edit
rs_data!found = "YES"

rs_data.Update ' ****BLOWS UP HERE
SQL_str = "select item_number,component from vs1_BOM where item = " & rs_data!item_id & " "
Set rs_chk = DB.OpenRecordset(SQL_str, dbOpenDynaset)
If Not rs_chk.EOF Then
rs_chk.MoveFirst
Do Until rs_chk.EOF
If Not IsNull(rs_chk!item_number) And rs_chk!Component <> 0 Then
SQL_str = "select item_id, item_number from keepers where item_id = " & rs_chk!Component & " "
Set rs_chk2 = DB.OpenRecordset(SQL_str, dbOpenDynaset)
If rs_chk2.EOF Then
SQL_str = "select item_id, item_number from other_keepers where item_id = " & rs_chk!Component & " "
Set rs_chk3 = DB.OpenRecordset(SQL_str, dbOpenDynaset)
If rs_chk3.EOF Then
tcnt = tcnt + 1
rs_keep.AddNew
rs_keep!item_number = rs_chk!item_number
rs_keep!item_id = rs_chk!Component
rs_keep.Update
End If
rs_chk3.Close
End If
rs_chk2.Close
End If
rs_chk.MoveNext
Loop
End If
rs_data.MoveNext
Loop
rs_data.Close
 
I don't see how this:

rs_data!found = "YES"

Could be connected to what you've described. Is it possible that it's blowing up at another 'update' command?
 
It processes the rs_data!found = "YES" fine. I've stepped through the code in debug. It's when it gets to that next update statement that if blows up. It doesn't do it initially, the code can run for 20 mins or so (processing half a million records), it's when it gets to the item_number field and it contains a forward slash.

In the past, when using other languages such as java in combination with oracle products we have noticed that even though Oracle states you can use special characters, any custom code may interpret slashes as additional paths in a folder structure. In this case, when a delete query was run to remove the / the module worked. My problem is that I need the forward slash to preserve the intergrity of the data. So I need a work around.
 

Users who are viewing this thread

Back
Top Bottom