Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

3146 ODBC Call Failed

Posted on 2000-03-05
7
Medium Priority
?
553 Views
Last Modified: 2012-06-22
Now i'm using existing program(VB), when i tried to save the data (SQL server), the error 3146 ODBC call failed occurred.

This error is too general, so tried to run the source code to trace the exact error. It said some of the fields of the table cannot contain null value.
But nobody change the data structure, why this error occurred?

Actually this application been used for yrs oledy, but suddenly hit this error.
Don't know what's wrong?
When i try to ammend the program and insert a default value to that non-null field, the data was inserted succesfuly...why?

Thanks

Phoebe
0
Comment
Question by:siiking
7 Comments
 
LVL 1

Expert Comment

by:vujos
ID: 2585001
0
 
LVL 2

Accepted Solution

by:
alokanant earned 200 total points
ID: 2586481
i think the data u r trying to save, includes a null value for a field in the table, which has been set not to accept null values.
There is no problem with the data structure.

hth
alok.
0
 

Expert Comment

by:kd123
ID: 2587900
One thing to remember. SQL Server view a null and a blank as two different things.  A blank is a white space that has a character value.  Best to check your data and run some queries to see if you have any nulls.  If you do, then you can update them to blanks. (verify the table structure in SQL Server to see if nulls are allowed.)
Also if you have a large amount of data and/or a complicated query, then you might need to change your query timeout settings in the registry.  Depending on the app, is where you will find it in the registry. Do a search for Query Timeout. Most apps set it to a default of 60 (seconds).  You might want to up it.
Last but not least, check to see if you have correct connectivity.  This is a very common error messsge for SQL when it simply can not connect to the table in question.
0
Get your Conversational Ransomware Defense e‑book

This e-book gives you an insight into the ransomware threat and reviews the fundamentals of top-notch ransomware preparedness and recovery. To help you protect yourself and your organization. The initial infection may be inevitable, so the best protection is to be fully prepared.

 

Author Comment

by:siiking
ID: 2591778
Edited text of question.
0
 

Expert Comment

by:kd123
ID: 2591946
Is the application new to the data or vise versa?  You may have contraints in you app that are not necessarily in your physical data structure.  The app would then force the rule.  Typically, they should match, but you have indicated that this is a new error.  The best trace for new errors is always, 'what has changed recently?'.  Have you checked the structure of your SQL table?  If you recently converted from another database system the configurations could have been set to default 'nulls not allowed' for columns unless directly specified.  Again, what is new since you started receiving the error?
0
 

Author Comment

by:siiking
ID: 2592040
Edited text of question.
0
 

Author Comment

by:siiking
ID: 2622447
u r rite..

Thanks
0

Featured Post

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Ever needed a SQL 2008 Database replicated/mirrored/log shipped on another server but you can't take the downtime inflicted by initial snapshot or disconnect while T-logs are restored or mirror applied? You can use SQL Server Initialize from Backup…
In part one, we reviewed the prerequisites required for installing SQL Server vNext. In this part we will explore how to install Microsoft's SQL Server on Ubuntu 16.04.
Via a live example combined with referencing Books Online, show some of the information that can be extracted from the Catalog Views in SQL Server.
This videos aims to give the viewer a basic demonstration of how a user can query current session information by using the SYS_CONTEXT function

963 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