Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Run-Time error 3622

26 views
Skip to first unread message

Sabineke

unread,
Sep 22, 2008, 4:11:02 AM9/22/08
to
Hi,

Have a DB with linked tables to a SQL server.

Get following error when I try to delete some records in a table from within
VBA.
The records must match a value in a form "projectnr"

Run-Time Error 3622 : You must use the DBSeechanges option with
OpenRecordset when accessins a SQL server Table that has an IDENTITY column.

Here's my code :

Dim strSQL As String

strSQL = "DELETE TblEF.IDFE, TblEF.IDPFE, TblEF.Titel, TblEF.Finan,
TblEF.POrg " & _
" FROM TblEF" & _
" WHERE TblEF.IDPFE = " & [Forms]![FrmProjecten]![ProjectNr]

DBEngine(0)(0).Execute strSQL, dbFailOnError

Before I made the link to the SQL server tables this code worked in Access
(Tables in same DB)

Can Anyone help me. I'm just a starter on working this way.

Thanks in advance
Sabine


Brendan Reynolds

unread,
Sep 22, 2008, 4:38:37 AM9/22/08
to
"Sabineke" <Sabi...@discussions.microsoft.com> wrote in message
news:4AEB86D0-7A74-409E...@microsoft.com...


Change this line ...

DBEngine(0)(0).Execute strSQL, dbFailOnError

... to ...

DBEngine(0)(0).Execute strSQL, dbFailOnError Or dbSeeChanges

Although the error message only refers to the OpenRecordset method, the
requirement to use dbSeeChanges under these circumstances also applies to
the Execute method.

--
Brendan Reynolds

Sabineke

unread,
Sep 23, 2008, 6:38:14 AM9/23/08
to
HI Brendan,

Thanks for your help, my problem is solved.

Sabine

Julian

unread,
Feb 14, 2011, 3:09:56 PM2/14/11
to
Hi Brendan,

The solution can be in SQL Server? or I have to change the code.

> On Monday, September 22, 2008 4:11 AM Sabinek wrote:

> Hi,
>
> Have a DB with linked tables to a SQL server.
>
> Get following error when I try to delete some records in a table from within
> VBA.
> The records must match a value in a form "projectnr"
>
> Run-Time Error 3622 : You must use the DBSeechanges option with
> OpenRecordset when accessins a SQL server Table that has an IDENTITY column.
>
> Here's my code :
>
> Dim strSQL As String
>
> strSQL = "DELETE TblEF.IDFE, TblEF.IDPFE, TblEF.Titel, TblEF.Finan,
> TblEF.POrg " & _
> " FROM TblEF" & _
> " WHERE TblEF.IDPFE = " & [Forms]![FrmProjecten]![ProjectNr]
>
> DBEngine(0)(0).Execute strSQL, dbFailOnError
>
> Before I made the link to the SQL server tables this code worked in Access
> (Tables in same DB)
>
> Can Anyone help me. I'm just a starter on working this way.
>
> Thanks in advance
> Sabine


>> On Monday, September 22, 2008 4:38 AM Brendan Reynolds wrote:

>> "Sabineke" <Sabi...@discussions.microsoft.com> wrote in message
>> news:4AEB86D0-7A74-409E...@microsoft.com...
>>
>>

>> Change this line ...
>>
>> DBEngine(0)(0).Execute strSQL, dbFailOnError
>>
>> ... to ...
>>
>> DBEngine(0)(0).Execute strSQL, dbFailOnError Or dbSeeChanges
>>
>> Although the error message only refers to the OpenRecordset method, the
>> requirement to use dbSeeChanges under these circumstances also applies to
>> the Execute method.
>>
>> --
>> Brendan Reynolds


>>> On Tuesday, September 23, 2008 6:38 AM Sabinek wrote:

>>> HI Brendan,
>>>
>>> Thanks for your help, my problem is solved.
>>>
>>> Sabine
>>>
>>> "Brendan Reynolds" wrote:


>>> Submitted via EggHeadCafe
>>> ASP.NET Base64 Image Encoding via the Data: protocol
>>> http://www.eggheadcafe.com/tutorials/aspnet/70f76817-e6d2-415d-8849-849d8c6c5385/aspnet-base64-image-encoding-via-the-data-protocol.aspx

0 new messages