ODBC Call Error

C

Chuck216

I Have an Access 2003 front end linked to a SQL 2005 back end. I’m trying to
run this code and get an ODBC Call Failed error 3146 at the ".Update"

Any help with this will be greatly appreciated
Chuck

____________________________________________________________________

Private Sub Command112_Click()


Dim db As DAO.Database
Dim rst As DAO.Recordset

If DCount("*", "tblDownTime", "DateValue([Date])=Date() AND [Ride] =
'Wings ' AND [Safety] is not Null") > 0 Then
'Do nothing
Else


Set db = DBEngine(0)(0)
Set rst = db.OpenRecordset(cTableDownTimeCBO, dbOpenDynaset, dbSeeChanges)
With rst
.AddNew
![Date] = Date
![TimeDown] = Time()
![Ride] = "Wings"
![Classification] = "Weather"
![Reason] = "Weather"
.Update --------------------------------------------Here is where I get
the Run Time error 3146 ODBC Call Failed

End With

End If

Exit_Sub:
On Error Resume Next
rst.Close
Set rst = Nothing
Set db = Nothing


End Sub
 
T

Tom Wickerath

Hi Chuck,

Do you have the required permissions to change data in this linked table? I
did a search on 3146, and this appears to be related to security on the SQL
Server table:

http://www.microsoft.com/communitie...rity&mid=b9fcc5a8-946c-4e6d-8231-f4d7102ba78b

I honestly don't know if this is a security issue in your case; I'm just
taking my best guess at trying to help you out...

This KB article indicates that you may be able to get more information about
the cause of the error:

How to Retrieve Info from RAISERROR Function in SQL Server DB
http://support.microsoft.com/kb/120763

Does the table in SQL Server include a field designated as the primary key?
If not, you should have a primary key field in your table. Have you made any
design changes to the linked table, after you created the ODBC link? If the
answer is yes (or maybe), then try deleting the linked table in Access,
compact the database (hold down the shift key to disable startup routines),
and then re-establish the linked table from scratch.


Tom Wickerath
Microsoft Access MVP
http://www.accessmvp.com/TWickerath/
http://www.access.qbuilt.com/html/expert_contributors.html
__________________________________________
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top