Solved

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

Posted on 2014-04-17
7
2,022 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
PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

 

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

Windows Server 2016: All you need to know

Learn about Hyper-V features that increase functionality and usability of Microsoft Windows Server 2016. Also, throughout this eBook, you’ll find some basic PowerShell examples that will help you leverage the scripts in your environments!

Question has a verified solution.

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

Entering time in Microsoft Access can be difficult. An input mask often bothers users more than helping them and won't catch all typing errors. This article shows how to create a textbox for 24-hour time input with full validation politely catching …
The Delta outage: 650 cancelled flights, more than 1200 delayed flights, thousands of frustrated customers, tens of millions of dollars in damages – plus untold reputational damage to one of the world’s most trusted airlines. All due to a catastroph…
Basics of query design. Shows you how to construct a simple query by adding tables, perform joins, defining output columns, perform sorting, and apply criteria.
Viewers will learn how to use the SELECT statement in SQL and will be exposed to the many uses the SELECT statement has.

778 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