Solved

ODBC Fail error adding record to SQL server table (in MS Access)

Posted on 2014-04-17
7
2,080 Views
Last Modified: 2014-04-17
I have an Access Linked (To SQL Server) table.
Using VBA I open it as a DAO Recordset, DbOpenDynaset, DBSeeChanges
I add a record  (.AddNew, !Fieldx=1, .Update).  No issues, no errors.  I see it in SQL server.
I attempt to add another record and get ODBC Fail Error.
I tried changing the code to use DoCmd.Execute a query (with DBSeeChanges) that appends the record.  Nada....
I tried all sorts of fixes including closing table and relinking it (In the error trap code).
I added a TimeStamp field to the SQL Table.  (Although existing records, the field appears to be NULL  New record has a value)
DoEvents everywhere.
Nothing works.  Please help!
(This is not simple.  I have Expert level experience with Access and good experience with SQL Server.)
0
Comment
Question by:SMAHelpDesk
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 5
  • 2
7 Comments
 
LVL 57

Accepted Solution

by:
Jim Dettman (Microsoft MVP/ EE MVE) earned 500 total points
ID: 40007215
What's the error?   3146?  If so, follow the instructions here for modifying your error trapping to get the true error:

How To Get More Information on the ODBC Call Failed Error
http://support.microsoft.com/kb/161288

Jim.

PS.  Thanks for indicating your experience level...sometimes it's very hard to know where to start<g>
0
 

Author Comment

by:SMAHelpDesk
ID: 40007243
No sense wasting everybody's time.  Thanks Jim.  I will take a look at this one.
0
 

Author Comment

by:SMAHelpDesk
ID: 40007249
Speaking of wasting time, forgot to mention:  Yes, 3146 error.  "ODBC--call failed."
0
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 

Author Comment

by:SMAHelpDesk
ID: 40007312
Give the man a Gold Star! I am definitely going to put that M$ link in my knowlegebase (lack of knowlege?) !  I guess I am not expert enough.  This is the first time I worked with the Errors collection like this.

I found that there was an index that needed to be updated as well.  This is what I get for changing the design of the database.

THANKS, Jim, for the tip.
0
 

Author Closing Comment

by:SMAHelpDesk
ID: 40007316
Slam Dunk!
0
 
LVL 57
ID: 40007409
No problem.  Glad to hear your squared away.

Jim.
0
 

Author Comment

by:SMAHelpDesk
ID: 40007453
(The more detailed [less obtuse] message from the Errors collection, showed that there was an issue with one of the indexes - a simple fix, really.)  Thanks again.
0

Featured Post

U.S. Department of Agriculture and Acronis Access

With the new era of mobile computing, smartphones and tablets, wireless communications and cloud services, the USDA sought to take advantage of a mobilized workforce and the blurring lines between personal and corporate computing resources.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Force application to connect using sql native client for mirroring 3 18
Remove () 10 40
SQL Query 9 27
sql server query 9 26
Did you know that more than 4 billion data records have been recorded as lost or stolen since 2013? It was a staggering number brought to our attention during last week’s ManageEngine webinar, where attendees received a comprehensive look at the ma…
In the first part of this tutorial we will cover the prerequisites for installing SQL Server vNext on Linux.
With Microsoft Access, learn how to start a database in different ways and produce different start-up actions allowing you to use a single database to perform multiple tasks. Specify a start-up form through options: Specify an Autoexec macro: Us…
Access reports are powerful and flexible. Learn how to create a query and then a grouped report using the wizard. Modify the report design after the wizard is done to make it look better. There will be another video to explain how to put the final p…

732 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