Solved

Having trouble adding a record to a SQL Server table.... Error 3622

Posted on 2011-09-07
2
259 Views
Last Modified: 2012-05-12
I am using an access front end to add a record to a Sql Server table using a variation of the code below.   The record is not added and the following error is returned:

Error 3622: You must use the dbSeeChanges option with OpenRecordset when accessing a SQL Server table that has an IDENTITY column.

What do I need to change to make this work please?
With CurrentDb.OpenRecordset("SELECT * FROM dbo_TimeSheets WHERE 1=2", 2, 8)
                   .AddNew
                     !TPID = Me.TPID
                     !EmployeeID = Me.EmployeeID
                     !Labor_Date = Me.Labor_Date
                     !No_Of_Hours = Me.No_Of_Hours
                     !Labor_Code = Me.Labor_Code
                   .Update
                   .Close
    End With

Open in new window

0
Comment
Question by:snyperj
2 Comments
 
LVL 119

Accepted Solution

by:
Rey Obrero earned 500 total points
ID: 36500431

try this

With CurrentDb.OpenRecordset("SELECT * FROM dbo_TimeSheets WHERE 1=2",dbopendynaset, dbseechanges)
0
 

Author Comment

by:snyperj
ID: 36500461
thanks...
0

Featured Post

Highfive + Dolby Voice = No More Audio Complaints!

Poor audio quality is one of the top reasons people don’t use video conferencing. Get the crispest, clearest audio powered by Dolby Voice in every meeting. Highfive and Dolby Voice deliver the best video conferencing and audio experience for every meeting and every room.

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
how to call a sub using a string variable? 20 57
Input box criteria 3 18
Resize text 4 15
DCount using "OR" 4 17
Experts-Exchange is a great place to come for help with solutions for your database issues, and many problems are resolved within minutes of being posted.  Others take a little more time and effort and often providing a sample database is very helpf…
Describes a method of obtaining an object variable to an already running instance of Microsoft Access so that it can be controlled via automation.
Familiarize people with the process of utilizing SQL Server functions from within Microsoft Access. Microsoft Access is a very powerful client/server development tool. One of the SQL Server objects that you can interact with from within Microsoft Ac…
Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…

708 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

13 Experts available now in Live!

Get 1:1 Help Now