SAS Office Analytics, SAS Add-In for Microsoft Office, and other integrations

adding new records violating integrity constraints - table lock problem

Reply
Contributor
Posts: 60

adding new records violating integrity constraints - table lock problem

I want to add new records to existing sas table using ADO and iom.provider.

I have no problem with doing so when table has no constraints - the problem begins when record being added violates integrity constraints.

I try to connect in an usuall way by:

opening recordset

rs.Open TableName, , adOpenStatic, adLockPessimistic, adCmdTableDirect

rs.movefirst

do until rs.EOF

rs.AddNew

rs.field1 = value1

rs.field2 - value2

...

rs.update

loop

The system returns error on rs.update and what's irritating - rs is no longer available and table is remains locked - there is no possiblity to cancel update so that the table would not remain locked - i tried rs.cancelupdate and rs.close but with no success.

Am I doing something wrong?

Ask a Question
Discussion stats
  • 0 replies
  • 232 views
  • 0 likes
  • 1 in conversation