?
Solved

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

Posted on 2014-04-17
7
Medium Priority
?
2,142 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 2000 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
Get MongoDB database support online, now!

At Percona’s web store you can order your MongoDB database support needs in minutes. No hassles, no fuss, just pick and click. Pay online with a credit card. Handle your MongoDB database support now!

 

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

Get 15 Days FREE Full-Featured Trial

Benefit from a mission critical IT monitoring with Monitis Premium or get it FREE for your entry level monitoring needs.
-Over 200,000 users
-More than 300,000 websites monitored
-Used in 197 countries
-Recommended by 98% of users

Question has a verified solution.

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

Recently we ran in to an issue while running some SQL jobs where we were trying to process the cubes.  We got an error saying failure stating 'NT SERVICE\SQLSERVERAGENT does not have access to Analysis Services. So this is a way to automate that wit…
What if you have to shut down the entire Citrix infrastructure for hardware maintenance, software upgrades or "the unknown"? I developed this plan for "the unknown" and hope that it helps you as well. This article explains how to properly shut down …
In Microsoft Access, learn different ways of passing a string value within a string argument. Also learn what a “Type Mis-match” error is about.
Viewers will learn how to use the SELECT statement in SQL and will be exposed to the many uses the SELECT statement has.
Suggested Courses

762 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