Talk About Network

Google


Register and Login
Nick
Password
Register create new account Sign up is FREE and you can post replies, new topics, bookmark posts and more!
Recover lost password


Programming > Clipper Visual-Objects > Question for Wi...
Latest [ Topics | Posts ] Archive Post A New Topic Post a Reply
<< Topic < Post Post 1 of 3 Topic 11292 of 11560
Post > Topic >>

Question for Willie

by Ian <ithomson@[EMAIL PROTECTED] > Apr 7, 2008 at 04:01 AM

Hi Willie,

I took your advice about cascading deletes and set up my tables
accordingly. Having tested this it works a treat but can you clarify
one thing for me.

The code I use is below

lOCAL nRecords         as LONG
lOCAL oRS              as ADORecordset
lOCAL oCommand         as ADOCommand
lOCAL cbErr            as CODEBLOCK
local lResult :=false  as logic
locAL uError           as USUAL
local cErrMsg          as string

cbErr   := ErrorBlock({|oErr|_Break(oErr)})

BEGIN SEQUENCE
   oCommand                  :=AdoCommand{}
   oCommand:ActiveConnection :=oDataConn
   oCommand:CommandText      :=cSql
   oCommand:CommandType      :=adCmdText
   oCommand:CommandTimeout   :=0
   oRS                       :=oCommand:Execute(@[EMAIL PROTECTED]
)
   oRS                       :=null_object
   oCommand                  :=null_object
		 lResult                   :=true
   ErrorBlock(cbErr)
   RECOVER USING uError
   ErrorBlock(cbErr)
   IF IsObject(uError)
    cErrMsg := "SQLConnection:ExecCommand Statement Error : " +
uError:Description +
    CRLF + "Delete Instruction Failed"
  ELSEIF IsString(uError)
   cErrMsg := uError + CRLF + "Delete Instruction Failed"
  ENDIF
  ErrorBox{,cErrMsg}:show()
END SEQUENCE
return nRecords

If there are twenty records in the details file but only ten can be
deleted for whatever reason, will this leave all twenty records intact
or do I have to do some kind of rollback to recover the ten that were
deleted.

ie If it can not delete all twenty detail records it should not delete
any.

Regards,
Ian
 




 3 Posts in Topic:
Question for Willie
Ian <ithomson@[EMAIL P  2008-04-07 04:01:38 
Re: Question for Willie
"Willie Moore"   2008-04-08 21:44:58 
Re: Question for Willie
Ian <ithomson@[EMAIL P  2008-04-09 01:32:16 

Post A Reply:
  Go here to Signup

AddThis Feed Button


About - Advertising - Contact - Frequently Asked Questions - Privacy Policy - Terms of Use - Signup

Contact
tan12V112 Fri Jul 25 16:27:24 CDT 2008.