Solved

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

Posted on 2014-04-17
7
1,963 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
  • 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
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: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

Free Trending Threat Insights Every Day

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

Join & Write a Comment

A theme is a collection of property settings that allow you to define the look of pages and controls, and then apply the look consistently across pages in an application. Themes can be made up of a set of elements: skins, style sheets, images, and o…
A simple tool to export all objects of two Access files as text and compare it with Meld, a free diff tool.
Using examples as well as descriptions, and references to Books Online, show the documentation available for datatypes, explain the available data types and show how data can be passed into and out of variables.
Viewers will learn how to use the SELECT statement in SQL and will be exposed to the many uses the SELECT statement has.

706 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

16 Experts available now in Live!

Get 1:1 Help Now