Solved

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

Posted on 2014-04-17
7
2,097 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 58

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
Ransomware-A Revenue Bonanza for Service Providers

Ransomware – malware that gets on your customers’ computers, encrypts their data, and extorts a hefty ransom for the decryption keys – is a surging new threat.  The purpose of this eBook is to educate the reader about ransomware attacks.

 

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 58
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

Raise the IQ of Your IT Alerts

From IT major incidents to manufacturing line slowdowns, every business process generates insights that need to reach the people required to take action. You need a platform that integrates with your business tools to create fully enabled DevOps toolchains.

You need xMatters.

Question has a verified solution.

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

This article describes two methods for creating a combo box that can be used to add new items to the row source -- one for simple lookup tables, and one for a more complex row source where the new item needs data for several fields.
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.
In Microsoft Access, when working with VBA, learn some techniques for writing readable and easily maintained code.
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…

691 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