UtterAccess.com
X   Site Message
(Message will auto close in 2 seconds)

Welcome to UtterAccess! Please ( Login   or   Register )

Custom Search
 
   Reply to this topicStart new topic
> Error 3156 on delete record from table.    
 
   
pivot35
post Sep 30 2005, 02:21 PM
Post#1



Posts: 9
Joined: 20-July 05



I have form build on query, that requiring link table in SQL Server. Some time when I need to delete record
by using Delete key or from right click mouse I get error
“Error 3156 – ODBC – delete on a linked table failed.”
can not debug this errort because there is no code for delete, delete function is build in Access.
If I use SQL Server tools and do delete record it work.
Ofound out the problem is in time out rang, in SQL is 600 second and in Access is 60
I try to increase Access time out from option advance, it dose not help.
Any idea to solve this problem? Or how I can debug on delete record on form?
compute.gif
Go to the top of the page
 
strive4peace
post Oct 1 2005, 08:50 PM
Post#2


strive4peace
Posts: 20,385
Joined: 10-January 04



if the form has >1 table in the recordset, perhaps it is not updateable...
Try opening the recordset directly without the form and see if you can delete
It is best to base each form on just one table
another option is, if you can delete the record through code, put a DELETE button on your form and do it that way -- you can also use a DELETE QUERY
CODE
   dim s as string
   s = "DELETE * FROM Tablename WHERE [color="blue"]conditions[/color];"
'remove next line after debugged
debug.print s
   currentdb.execute s
   currentdb.tabledefs.refresh
   DoEvents
Go to the top of the page
 
pivot35
post Oct 3 2005, 08:00 AM
Post#3



Posts: 9
Joined: 20-July 05



Thanks Crystal,
Form base on one query. This query is base on 5 table. If I open query in datasheet view and do delete, It work.
My question is I need to debug this error from VBA to write some code to delay the process until the result come from SQL Server
Go to the top of the page
 
strive4peace
post Oct 3 2005, 08:03 AM
Post#4


strive4peace
Posts: 20,385
Joined: 10-January 04



I would recommend seperate SQL to delete record(s) out of each of the tables -- starting with the child tables then last doing the parent
Go to the top of the page
 
WynApse
post Oct 14 2005, 04:41 PM
Post#5



Posts: 96
Joined: 8-August 05



Thanks for the advice in this post.
had a delete that involved an inner join of two linked Oracle tables in some code I'm supporting, and it was choking.
After reading your comments, I did a select on the field that was used in the join using the rest of the criteria in the query, and pulled that to a RecordSet. Then I walked the recordset deleting from both tables one at a time.
Worked great, and got rid of the ODBC error!
-Dave
Go to the top of the page
 
strive4peace
post Oct 14 2005, 06:22 PM
Post#6


strive4peace
Posts: 20,385
Joined: 10-January 04



you're welcome, Dave wink.gif happy to help
Welcome to Utter Access
Go to the top of the page
 


Custom Search


RSSSearch   Top   Lo-Fi    23rd May 2019 - 07:55 AM