dbseechanges

I have a SQL table with an Identity field linked into an Access database.  I am trying to execute the delete SQL statement below, but I am receiving a 3622 run time error.


set dbs = currentdb
dbs.Execute "delete * from tbl10_MonthlyMDExtract"

I found a reference to the error, but I am not sure how to fix it since I am not using an OpenRecordset command.  

Note   If you attempt to access a SQL Server 6.0 table that includes an identity column, you can trigger an erroneous 3622 error. To prevent this problem, use the dbSeeChanges option with the Options property or OpenRecordset method.

Any ideas?



klb37777Asked:
Who is Participating?
 
Data-ManConnect With a Mentor COOCommented:
If that doesn't solve your problem, then do this.

set dbs = currentdb
dbs.Execute "delete from tbl10_MonthlyMDExtract", dbSeeChanges


Mike

0
 
DanielSKimCommented:
sql server delete syntax does not have the asterisk:

set dbs = currentdb
dbs.Execute "delete from tbl10_MonthlyMDExtract"
0
 
klb37777Author Commented:
I had already tried taking the asterisk out and still received the error.  I had also tried adding the dbSeeChanges to the statement but I put it inside the quotes instead of outside.  

It worked when I put it outside the quotes.  Thanks for the help.
0
 
Data-ManCOOCommented:
:-)

Mike
0
All Courses

From novice to tech pro — start learning today.