Solved

ODBC Call Failed Error 3146

Posted on 1998-10-12
6
376 Views
Last Modified: 2012-06-21
I'm using SQL 6.5 under WinNT. When I try and add/delete information from my database I keep getting an ODBC call failed error. I have truncated the log and though it looks empty when I run a dbcc checktable(syslogs) and dbcc sqlperf (logspace) when I say edit DB it still looks as full as it was. I've truncated, restored from a previous backup, but no luck. I am NOT a sql expert so any help would be appreciated.
0
Comment
Question by:popnetworks
6 Comments
 
LVL 7

Expert Comment

by:spiridonov
ID: 1090501
What application are you using to add,delete records? Do you have enough permissions? Are you logged in as sa? ODBC call failed is only a generic first part of the error message, there should be second part containing error returned by SQL Server.
0
 

Expert Comment

by:tunct
ID: 1090502
3146 is something like a timeout error code... I usually got it when the db was full or the server was performing a heavy task.

The transaction log fills up quickly if you have large transactions (logical, ain't it :). So you may choose to "truncate log on checkpoints", which means, after each successful transaction, the log is discarded.

T.
ps: Is the log on a separate device?
0
 
LVL 2

Expert Comment

by:mkmccreary
ID: 1090503
If I remember correctly, 'Truncate Log on Checkpoint' it only truncates the log after a dump to the last successful transaction before the checkpoint.  What may have happened is you have a hung transaction in the log.  If this transaction is at the end of the log, it will not truncate properly.  I've had this problem before, and I'm trying to remember how I fixed it.  I want to say I dumped the database, dropped the database and its devices, and then recreated it from scratch.  Not a good solution, though.  I will continue to think about it.  You may want to see what the way is to determine the hung transactions in the log, and how to clear them.  I think that will get you on the right track.

Later,
Martin
0
How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

 

Author Comment

by:popnetworks
ID: 1090504
Yes, I was logged in as sa, did have enough permissions and was using a VB created client application to access the server. I checked both the server and operating system logs but could not find other information on the error. The log was on a separate device. Yesterday I had it and deleted everything, reinstalled SQL, installed Service Pack 4, recreated my database and log devices and recreated my database from a recent backup. I deleted old tables and rows from my db as it had grown to over 1gb (probably not the best idea but it was info I didn't need), I truncated the log (again) and performed some dbcc commands to check the status of the tables and logs. I did get the message that the number of data pages and rows in my Sysindexes were corrected from some awfully large numbers to 1 and 12 respectively. Now I seem to be ok. I did make sure the truncate log on checkpoint was active and I'm HOPING I won't get this error again! Any additional thoughts? (besides to upgrade to 7.0 when it comes out?)
0
 
LVL 7

Accepted Solution

by:
spiridonov earned 50 total points
ID: 1090505
>>3146 is something like a timeout error code.

ODBC call failed error 3146 is a generic error it might be timeout, but it might be as well almost ANY OTHER ODBC related error. You ust cycle through Errors collection to determine REAL error. The code, that shows how to do it in VB is shown in MS Knowledge base article Q161288.
0
 

Expert Comment

by:xzeina
ID: 1090506
i have encountered this problem before, but i do not know why it happenned.,in fact, i couldn't add any new row in the table,,,
what i have done is the following :
for example if the damaged table name is "table1"
-first , go to sql enterprise and rename this table to "otable1"
 -then go to Ms Query and write down the following

select *
into table1
from otable1
 THIS CODE WILL create a new table from the old one
-After creating table1, goto sql server enterprise, select table1 and reestablish its primary key...
hoping it works..
regards
zeina
0

Featured Post

IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

Introduced in Microsoft SQL Server 2005, the Copy Database Wizard (http://msdn.microsoft.com/en-us/library/ms188664.aspx) is useful in copying databases and associated objects between SQL instances; therefore, it is a good migration and upgrade tool…
Having an SQL database can be a big investment for a small company. Hardware, setup and of course, the price of software all add up to a big bill that some companies may not be able to absorb.  Luckily, there is a free version SQL Express, but does …
This video shows how to set up a shell script to accept a positional parameter when called, pass that to a SQL script, accept the output from the statement back and then manipulate it in the Shell.
Viewers will learn how to use the SELECT statement in SQL and will be exposed to the many uses the SELECT statement has.

746 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

17 Experts available now in Live!

Get 1:1 Help Now