Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Error -346 using ole driver. Could not update row...

Status
Not open for further replies.

aco636

IS-IT--Management
Nov 25, 2003
212
GB
Hi there

As always, any help gratefully received.

I have written a small vb script to update various records in an informix database.
However, when I run my connection.execute(sql) line I receive the following error;
EIX000: 9-346) Could not update a row in the table.

I have checked the sql statement and it works fine in the informix SQL Editor app. I have also tried a few other simple sql statements and these also fail when using the vbs script.

It might be worth noting that I can run select statements from the vb script without a problem.

My main reason for wanting to do this is to slow things down because I need to do several thousand records.

Regards ACO
 
please post more details (code) to allow an analysis of your problem.
 
Hi there
Code:
UPDATE TableName SET passwd = 'abcabc', durcode = '', cname = 'Freddy Bloggs', caddr1 = '1 A Nice Road', caddr2 = 'ANYTOWN', caddr3 = 'AB1 2CD', cpostcode = '*COMMENT*', cphone = '01234-5678910-123456', cfax = '', userref = '0000000000' WHERE Serialno = 1234;

Although I dont want to post the actual data, it might be worth noting that some of the comments have '*' in the string

Code:
cniFmx.Open "Connection string"

Do Until objTextFile.AtEndOfStream
	
	
	sql = objTextFile.ReadLine
'Get the next sql statement
		
		
		WScript.Sleep(500)
		
		i = i + 1
                'Just test on first 5 to start
		
		If i = 5 Then
		
			Exit Do
		Else
	
	
		rc.Close
		
		cniFmx.BeginTrans	
			
		Set cmd.ActiveConnection = cniFmx

		cmd.CommandText = sql
		cmd.Execute
		
			If cniFmx.Errors.Count <> 0 Then
				
				cn.RollbackTrans
				WScript.Echo cniFmx.Errors.Item(0).Description
				cn.Errors.Clear
				
			End If
			
		cn.CommitTrans
		WScript.Echo " Row: " & i & " - " & Left(sql, 20)
'Just let me see it is doing something
			
		End If
						
	Loop

As you can see, nothing strange here
Regards ACO
 
explanation of informix error 346:

346 Could not update a row in the table.

While the database server was processing an UPDATE, it received an unexpected error. Check the accompanying ISAM error code for more detailed information on the cause. Possible causes include hardware errors and locking conflicts.

i.e. it could be possible, that your db-server ran out of space, extents, etc.

is it possible to update the table using direct sql, i.e. dbaccess ?

Is your "table" really a table or is it possibly a view, which cannot be updated at all?
 
hi there

The sql works fine if using the IBM Informix SQL Editor.
There will be no problem with resourse
Regards ACO
 
hmm, this seems not to be related to informix then. Maybe ask in a vb-forum, if they can help.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top