BookmarkSubscribeRSS Feed
tom12122
Obsidian | Level 7

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?

sas-innovate-2024.png

Don't miss out on SAS Innovate - Register now for the FREE Livestream!

Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.

 

Register now!

Discussion stats
  • 0 replies
  • 722 views
  • 0 likes
  • 1 in conversation