Profox People, I decided to add an audit trail feature into a small system here at Flexipol via the DBC Triggers roughly based on the example in MegaFox chapter 7.
In order to make things simple and more in line with OOP philosophy I decided to construct an Audit Class with all the logic embedded into a packaged class for adding into the audit tables. So far so good… However I now find that I cannot action the “add audit record" method in the class i.e.
oAudit.Log(”Add”, “”Customer”)
The prior created and visible object oAudit becomes invisible in the Trigger code despite being defined as a public variable.
In fact the situation is somewhat worse in that when executing Trigger code it seems you cannot create objects or access any existing object’s method code which I find strange indeed and I am interested why.
My only alternative is to go back to make all the auditing code .prg based which is fine but not an ideal solution.
Unless anyone has any other ideas…..or a reason why you can’t use existing objects or create objects in trigger code.
Ho Hum.
Dave
--------------------------------------------------------------- This communication and the information it contains is intended for the person or organisation to whom it is addressed. Its contents are confidential and may be protected in law. If you have received this e-mail in error you must not copy, distribute or take any action in reliance on it. Unauthorised use, copying or disclosure of any of it may be unlawful. If you have received this message in error, please notify us immediately by telephone or email.
Flexipol Packaging Ltd. has taken every reasonable precaution to minimise the risk of virus transmission through email and therefore any files sent via e-mail will have been checked for known viruses. However, you are advised to run your own virus check before opening any attachments received as Flexipol Packaging Ltd will not in any event accept any liability whatsoever once an e-mail and/or any attachment is received.
It is the responsibility of the recipient to ensure that they have adequate virus protection.
Flexipol Packaging Ltd. Unit 14 Bentwood Road Carrs Industrial Estate Haslingden Rossendale Lancashire BB4 5HH
Tel:01706-222792 Fax: 01706-224683 www.Flexipol.co.uk ---------------------------------------------------------------
Terms & Conditions:
Notwithstanding delivery and the passing of risk in the goods, the property in the goods shall not pass to the buyer until the seller Flexipol Packaging Ltd. ("The Company") has received in cash or cleared funds payment in full of the price of the goods and all other goods agreed to be sold by the seller to the buyer for which payment is then due. Until such time as the property in the goods passes to the buyer, the buyer shall hold the goods as the seller's fiduciary agent and bailee and keep the goods separate from those of the buyer and third parties and properly stored protected and insured and identified as the seller's property but shall be entitled to resell or use the goods in the ordinary course of its business. Until such time as the property in the goods passes to the buyer the seller shall be entitled at any time
Try passing oAudit in as a parameter to your trigger.
I started down this road once, but ended up purchasing FoxAudit because it did everything I needed in a much more robust fashion. I'm not sure if it's still marketed though.
Perhaps you could make oAudit a property of the _VFP object so it will always be available. (_vfp.addobject("oAudit", "class"))
On Tue, Oct 17, 2017 at 4:58 AM, Dave Crozier DaveC@flexipol.co.uk wrote:
Profox People, I decided to add an audit trail feature into a small system here at Flexipol via the DBC Triggers roughly based on the example in MegaFox chapter 7.
In order to make things simple and more in line with OOP philosophy I decided to construct an Audit Class with all the logic embedded into a packaged class for adding into the audit tables. So far so good… However I now find that I cannot action the “add audit record" method in the class i.e.
oAudit.Log(”Add”, “”Customer”)The prior created and visible object oAudit becomes invisible in the Trigger code despite being defined as a public variable.
In fact the situation is somewhat worse in that when executing Trigger code it seems you cannot create objects or access any existing object’s method code which I find strange indeed and I am interested why.
My only alternative is to go back to make all the auditing code .prg based which is fine but not an ideal solution.
Unless anyone has any other ideas…..or a reason why you can’t use existing objects or create objects in trigger code.
Ho Hum.
Dave
This communication and the information it contains is intended for the person or organisation to whom it is addressed. Its contents are confidential and may be protected in law. If you have received this e-mail in error you must not copy, distribute or take any action in reliance on it. Unauthorised use, copying or disclosure of any of it may be unlawful. If you have received this message in error, please notify us immediately by telephone or email.
Flexipol Packaging Ltd. has taken every reasonable precaution to minimise the risk of virus transmission through email and therefore any files sent via e-mail will have been checked for known viruses. However, you are advised to run your own virus check before opening any attachments received as Flexipol Packaging Ltd will not in any event accept any liability whatsoever once an e-mail and/or any attachment is received.
It is the responsibility of the recipient to ensure that they have adequate virus protection.
Flexipol Packaging Ltd. Unit 14 Bentwood Road Carrs Industrial Estate Haslingden Rossendale Lancashire BB4 5HH
Tel:01706-222792 Fax: 01706-224683 www.Flexipol.co.uk
Terms & Conditions:
Notwithstanding delivery and the passing of risk in the goods, the property in the goods shall not pass to the buyer until the seller Flexipol Packaging Ltd. ("The Company") has received in cash or cleared funds payment in full of the price of the goods and all other goods agreed to be sold by the seller to the buyer for which payment is then due. Until such time as the property in the goods passes to the buyer, the buyer shall hold the goods as the seller's fiduciary agent and bailee and keep the goods separate from those of the buyer and third parties and properly stored protected and insured and identified as the seller's property but shall be entitled to resell or use the goods in the ordinary course of its business. Until such time as the property in the goods passes to the buyer the seller shall be entitled at any time
[excessive quoting removed by server]
Hi Eric,
Just wondering, in which case would you addProperty(_vfp, …) rather than addProperty(_screen, …)
Could not figure out a sound reason so far…
Thierry Nivelet FoxInCloud Give your VFP app a second life in the cloud http://foxincloud.com/
Le 17/10/2017 à 15:28, Eric Selje a écrit :
Perhaps you could make oAudit a property of the _VFP object so it will always be available. (_vfp.addobject("oAudit", "class"))
Thierry, Will give that a shot...
Dave
--------------------------------------------------------------- This communication and the information it contains is intended for the person or organisation to whom it is addressed. Its contents are confidential and may be protected in law. If you have received this e-mail in error you must not copy, distribute or take any action in reliance on it. Unauthorised use, copying or disclosure of any of it may be unlawful. If you have received this message in error, please notify us immediately by telephone or email.
Flexipol Packaging Ltd. has taken every reasonable precaution to minimise the risk of virus transmission through email and therefore any files sent via e-mail will have been checked for known viruses. However, you are advised to run your own virus check before opening any attachments received as Flexipol Packaging Ltd will not in any event accept any liability whatsoever once an e-mail and/or any attachment is received.
It is the responsibility of the recipient to ensure that they have adequate virus protection.
Flexipol Packaging Ltd. Unit 14 Bentwood Road Carrs Industrial Estate Haslingden Rossendale Lancashire BB4 5HH
Tel:01706-222792 Fax: 01706-224683 www.Flexipol.co.uk ---------------------------------------------------------------
Terms & Conditions:
Notwithstanding delivery and the passing of risk in the goods, the property in the goods shall not pass to the buyer until the seller Flexipol Packaging Ltd. ("The Company") has received in cash or cleared funds payment in full of the price of the goods and all other goods agreed to be sold by the seller to the buyer for which payment is then due. Until such time as the property in the goods passes to the buyer, the buyer shall hold the goods as the seller's fiduciary agent and bailee and keep the goods separate from those of the buyer and third parties and properly stored protected and insured and identified as the seller's property but shall be entitled to resell or use the goods in the ordinary course of its business. Until such time as the property in the goods passes to the buyer the seller shall be entitled at any time
-----Original Message----- From: ProFox [mailto:profox-bounces@leafe.com] On Behalf Of Thierry Nivelet Sent: 17 October 2017 14:33 To: profox@leafe.com Subject: Re: Trigger design
Hi Eric,
Just wondering, in which case would you addProperty(_vfp, …) rather than addProperty(_screen, …)
Could not figure out a sound reason so far…
Thierry Nivelet FoxInCloud Give your VFP app a second life in the cloud http://foxincloud.com/
Le 17/10/2017 à 15:28, Eric Selje a écrit :
Perhaps you could make oAudit a property of the _VFP object so it will always be available. (_vfp.addobject("oAudit", "class"))
_______________________________________________ Post Messages to: ProFox@leafe.com Subscription Maintenance: http://mail.leafe.com/mailman/listinfo/profox OT-free version of this list: http://mail.leafe.com/mailman/listinfo/profoxtech Searchable Archive: http://leafe.com/archives/search/profox This message: http://leafe.com/archives/byMID/profox/632f5aa7-8404-73bf-8ca2-7ff3dcbd02b4@... ** All postings, unless explicitly stated otherwise, are the opinions of the author, and do not constitute legal or medical advice. This statement is added to the messages for those lawyers who are too stupid to see the obvious.
On Tue, Oct 17, 2017 at 9:33 AM, Thierry Nivelet tnivelet@foxincloud.com wrote:
Just wondering, in which case would you addProperty(_vfp, …) rather than addProperty(_screen, …)
A FoxPro DBC may be opened via ODBC/OLEDB rather than within a running FoxPro development or runtime session. _SCREEN is not available in an OLEDB context:
https://msdn.microsoft.com/en-us/subscriptions/downloads/bt5d78fx(v=vs.80)
cristal clear, thanks
Thierry Nivelet FoxInCloud Give your VFP app a second life in the cloud http://foxincloud.com/
Le 17/10/2017 à 16:10, Ted Roche a écrit :
On Tue, Oct 17, 2017 at 9:33 AM, Thierry Nivelet tnivelet@foxincloud.com wrote:
Just wondering, in which case would you addProperty(_vfp, …) rather than addProperty(_screen, …)
A FoxPro DBC may be opened via ODBC/OLEDB rather than within a running FoxPro development or runtime session. _SCREEN is not available in an OLEDB context:
https://msdn.microsoft.com/en-us/subscriptions/downloads/bt5d78fx(v=vs.80)
[excessive quoting removed by server]
I think the object attachment to _SCREEN has sorted out the problem ... so far so good.
Will report back after further testing.
Dave
--------------------------------------------------------------- This communication and the information it contains is intended for the person or organisation to whom it is addressed. Its contents are confidential and may be protected in law. If you have received this e-mail in error you must not copy, distribute or take any action in reliance on it. Unauthorised use, copying or disclosure of any of it may be unlawful. If you have received this message in error, please notify us immediately by telephone or email.
Flexipol Packaging Ltd. has taken every reasonable precaution to minimise the risk of virus transmission through email and therefore any files sent via e-mail will have been checked for known viruses. However, you are advised to run your own virus check before opening any attachments received as Flexipol Packaging Ltd will not in any event accept any liability whatsoever once an e-mail and/or any attachment is received.
It is the responsibility of the recipient to ensure that they have adequate virus protection.
Flexipol Packaging Ltd. Unit 14 Bentwood Road Carrs Industrial Estate Haslingden Rossendale Lancashire BB4 5HH
Tel:01706-222792 Fax: 01706-224683 www.Flexipol.co.uk ---------------------------------------------------------------
Terms & Conditions:
Notwithstanding delivery and the passing of risk in the goods, the property in the goods shall not pass to the buyer until the seller Flexipol Packaging Ltd. ("The Company") has received in cash or cleared funds payment in full of the price of the goods and all other goods agreed to be sold by the seller to the buyer for which payment is then due. Until such time as the property in the goods passes to the buyer, the buyer shall hold the goods as the seller's fiduciary agent and bailee and keep the goods separate from those of the buyer and third parties and properly stored protected and insured and identified as the seller's property but shall be entitled to resell or use the goods in the ordinary course of its business. Until such time as the property in the goods passes to the buyer the seller shall be entitled at any time
-----Original Message----- From: ProFox [mailto:profox-bounces@leafe.com] On Behalf Of Thierry Nivelet Sent: 17 October 2017 15:31 To: profox@leafe.com Subject: Re: Trigger design
cristal clear, thanks
Thierry Nivelet FoxInCloud Give your VFP app a second life in the cloud http://foxincloud.com/
Le 17/10/2017 à 16:10, Ted Roche a écrit :
On Tue, Oct 17, 2017 at 9:33 AM, Thierry Nivelet tnivelet@foxincloud.com wrote:
Just wondering, in which case would you addProperty(_vfp, …) rather than addProperty(_screen, …)
A FoxPro DBC may be opened via ODBC/OLEDB rather than within a running FoxPro development or runtime session. _SCREEN is not available in an OLEDB context:
https://msdn.microsoft.com/en-us/subscriptions/downloads/bt5d78fx(v=vs .80)
[excessive quoting removed by server]
_______________________________________________ Post Messages to: ProFox@leafe.com Subscription Maintenance: http://mail.leafe.com/mailman/listinfo/profox OT-free version of this list: http://mail.leafe.com/mailman/listinfo/profoxtech Searchable Archive: http://leafe.com/archives/search/profox This message: http://leafe.com/archives/byMID/profox/aa1100fd-265f-9f16-6dd6-042f09570733@... ** All postings, unless explicitly stated otherwise, are the opinions of the author, and do not constitute legal or medical advice. This statement is added to the messages for those lawyers who are too stupid to see the obvious.
Did a general search for FoxAudit because I was interested, but all I could find was a foreign company named FoxAudit and a lot of Foxpro tips where people recommended FoxAudit.
While doing so I ran across a Microsoft article describing how to build a VFP6 COM application and register and use it with MTS. Obviously, if this is the first I've run across this, I've never done it. Have any of the pros done this? Why didn't this become a bigger deal for Foxpro programmers or did I just miss this like Rip Van Winkle?
Just curious
Paul H. Tarver Email: paul@tpcqpc.com
-----Original Message----- From: ProfoxTech [mailto:profoxtech-bounces@leafe.com] On Behalf Of Eric Selje Sent: Tuesday, October 17, 2017 8:29 AM To: profoxtech@leafe.com Subject: Re: Trigger design
I started down this road once, but ended up purchasing FoxAudit because it did everything I needed in a much more robust fashion. I'm not sure if it's still marketed though.
Perhaps you could make oAudit a property of the _VFP object so it will always be available. (_vfp.addobject("oAudit", "class"))
On Tue, Oct 17, 2017 at 4:58 AM, Dave Crozier DaveC@flexipol.co.uk wrote:
Profox People, I decided to add an audit trail feature into a small system here at Flexipol via the DBC Triggers roughly based on the example in MegaFox chapter 7.
In order to make things simple and more in line with OOP philosophy I decided to construct an Audit Class with all the logic embedded into a packaged class for adding into the audit tables. So far so good… However I now find that I cannot action the “add audit record" method in the class i.e.
oAudit.Log(”Add”, “”Customer”)The prior created and visible object oAudit becomes invisible in the Trigger code despite being defined as a public variable.
In fact the situation is somewhat worse in that when executing Trigger code it seems you cannot create objects or access any existing object’s method code which I find strange indeed and I am interested why.
My only alternative is to go back to make all the auditing code .prg based which is fine but not an ideal solution.
Unless anyone has any other ideas…..or a reason why you can’t use existing objects or create objects in trigger code.
Ho Hum.
Dave
This communication and the information it contains is intended for the person or organisation to whom it is addressed. Its contents are confidential and may be protected in law. If you have received this e-mail in error you must not copy, distribute or take any action in reliance on it. Unauthorised use, copying or disclosure of any of it may be unlawful. If you have received this message in error, please notify us immediately by telephone or email.
Flexipol Packaging Ltd. has taken every reasonable precaution to minimise the risk of virus transmission through email and therefore any files sent via e-mail will have been checked for known viruses. However, you are advised to run your own virus check before opening any attachments received as Flexipol Packaging Ltd will not in any event accept any liability whatsoever once an e-mail and/or any attachment is received.
It is the responsibility of the recipient to ensure that they have adequate virus protection.
Flexipol Packaging Ltd. Unit 14 Bentwood Road Carrs Industrial Estate Haslingden Rossendale Lancashire BB4 5HH
Tel:01706-222792 Fax: 01706-224683 www.Flexipol.co.uk
Terms & Conditions:
Notwithstanding delivery and the passing of risk in the goods, the property in the goods shall not pass to the buyer until the seller Flexipol Packaging Ltd. ("The Company") has received in cash or cleared funds payment in full of the price of the goods and all other goods agreed to be sold by the seller to the buyer for which payment is then due. Until such time as the property in the goods passes to the buyer, the buyer shall hold the goods as the seller's fiduciary agent and bailee and keep the goods separate from those of the buyer and third parties and properly stored protected and insured and identified as the seller's property but shall be entitled to resell or use the goods in the ordinary course of its business. Until such time as the property in the goods passes to the buyer the seller shall be entitled at any time
[excessive quoting removed by server]
Fox Audit was written by Jim Duffy at TakeNote. I see the page for the product is no longer there, but his website (and contact info) is still up: takenote.com. Maybe you can contact him directly.
I'm not sure why it wasn't more prevalant. It worked well, with few caveats, for us. Of course the upsize to SQL Server made it obsolete.
E
On Tue, Oct 17, 2017 at 10:48 AM, Paul H. Tarver paul@tpcqpc.com wrote:
Did a general search for FoxAudit because I was interested, but all I could find was a foreign company named FoxAudit and a lot of Foxpro tips where people recommended FoxAudit.
While doing so I ran across a Microsoft article describing how to build a VFP6 COM application and register and use it with MTS. Obviously, if this is the first I've run across this, I've never done it. Have any of the pros done this? Why didn't this become a bigger deal for Foxpro programmers or did I just miss this like Rip Van Winkle?
Just curious
Paul H. Tarver Email: paul@tpcqpc.com
-----Original Message----- From: ProfoxTech [mailto:profoxtech-bounces@leafe.com] On Behalf Of Eric Selje Sent: Tuesday, October 17, 2017 8:29 AM To: profoxtech@leafe.com Subject: Re: Trigger design
I started down this road once, but ended up purchasing FoxAudit because it did everything I needed in a much more robust fashion. I'm not sure if it's still marketed though.
Perhaps you could make oAudit a property of the _VFP object so it will always be available. (_vfp.addobject("oAudit", "class"))
On Tue, Oct 17, 2017 at 4:58 AM, Dave Crozier DaveC@flexipol.co.uk wrote:
Profox People, I decided to add an audit trail feature into a small system here at Flexipol via the DBC Triggers roughly based on the example in MegaFox chapter 7.
In order to make things simple and more in line with OOP philosophy I decided to construct an Audit Class with all the logic embedded into a packaged class for adding into the audit tables. So far so good… However I now find that I cannot action the “add audit record" method in the class i.e.
oAudit.Log(”Add”, “”Customer”)The prior created and visible object oAudit becomes invisible in the Trigger code despite being defined as a public variable.
In fact the situation is somewhat worse in that when executing Trigger code it seems you cannot create objects or access any existing object’s method code which I find strange indeed and I am interested why.
My only alternative is to go back to make all the auditing code .prg based which is fine but not an ideal solution.
Unless anyone has any other ideas…..or a reason why you can’t use existing objects or create objects in trigger code.
Ho Hum.
Dave
This communication and the information it contains is intended for the person or organisation to whom it is addressed. Its contents are confidential and may be protected in law. If you have received this e-mail in error you must not copy, distribute or take any action in reliance on it. Unauthorised use, copying or disclosure of any of it may
be unlawful.
If you have received this message in error, please notify us immediately by telephone or email.
Flexipol Packaging Ltd. has taken every reasonable precaution to minimise the risk of virus transmission through email and therefore any files sent via e-mail will have been checked for known viruses. However, you are advised to run your own virus check before opening any attachments received as Flexipol Packaging Ltd will not in any event accept any liability whatsoever once an e-mail and/or any attachment is received.
It is the responsibility of the recipient to ensure that they have adequate virus protection.
Flexipol Packaging Ltd. Unit 14 Bentwood Road Carrs Industrial Estate Haslingden Rossendale Lancashire BB4 5HH
Tel:01706-222792 Fax: 01706-224683 www.Flexipol.co.uk
Terms & Conditions:
Notwithstanding delivery and the passing of risk in the goods, the property in the goods shall not pass to the buyer until the seller Flexipol Packaging Ltd. ("The Company") has received in cash or cleared funds payment in full of the price of the goods and all other goods agreed to be sold by the seller to the buyer for which payment is then due. Until such time as the property in the goods passes to the buyer, the buyer shall hold the goods as the seller's fiduciary agent and bailee and keep the goods separate from those of the buyer and third parties and properly stored protected and insured and identified as the seller's property but shall be entitled to resell or use the goods in the ordinary course of its business. Until such time as the property in the goods passes to the buyer the seller shall be entitled at any time
[excessive quoting removed by server]
On Tue, Oct 17, 2017 at 5:25 PM, Eric Selje eric.selje@gmail.com wrote:
Fox Audit was written by Jim Duffy at TakeNote. I see the page for the product is no longer there, but his website (and contact info) is still up: takenote.com. Maybe you can contact him directly.
And here's what the page looked like:
https://web.archive.org/web/20040531132304/http://www.takenote.com:80/Deskto...
I took a Foxpro training class with Jim Duffy back in the day. My hazy memory is he was a smart, entertaining guy; like so many of us Foxpro devs.... <vbg>
--
rk
-----Original Message----- From: ProfoxTech [mailto:profoxtech-bounces@leafe.com] On Behalf Of Ted Roche Sent: Tuesday, October 17, 2017 6:53 PM To: profoxtech@leafe.com Subject: Re: Trigger design
On Tue, Oct 17, 2017 at 5:25 PM, Eric Selje eric.selje@gmail.com wrote:
Fox Audit was written by Jim Duffy at TakeNote. I see the page for the product is no longer there, but his website (and contact info) is still up: takenote.com. Maybe you can contact him directly.
And here's what the page looked like:
https://web.archive.org/web/20040531132304/http://www.takenote.com:80/Deskto...
On 10/17/2017 5:58 AM, Dave Crozier wrote: ...
I decided to add an audit trail feature into a small system here at Flexipol via the DBC Triggers roughly based on the example in MegaFox chapter 7.
In order to make things simple and more in line with OOP philosophy I decided to construct an Audit Class with all the logic embedded into a packaged class for adding into the audit tables. So far so good… However I now find that I cannot action the “add audit record" method in the class i.e.
oAudit.Log(”Add”, “”Customer”)
...
My only alternative is to go back to make all the auditing code .prg based which is fine but not an ideal solution.
As I recall, the "database environment" can access the environment it was run within. So, for example, if you opened the database from an "application" all the "public" objects of the application are visible to the database code (such as triggers and stored procedures). But if you have to allow for the database to be opened via ODBC or OLEDB, then pretty much only the environment of the database is in scope.
So, you could take your auditing code and create stored procedures out of it and it should be available all the time. But there are some restrictions in a "database only" environment (I don't recall them at the moment - maybe "creating objects" was something that could not be done in database-only code - I'm pretty sure you can do SCATTER/GATHER though - may have to use the MEMVAR clause).
As a quick example, this is a generic log stored proc I had (it is a stored proc in a VFP database). No vouching for it: I don't know for sure that I tested this through ODBC, etc. Basically, I would call this in the trigger code (INSERT, DELETE, MODIFY) and would pass 2 parameters. E.g. in the Insert trigger I would put: "fn_LOGdata('a', <name of table getting the record inserted>). Of course there was some set up before this - aka the log tables exist in the DB, they have an identical structure to the table being logged plus a few other fields. So maybe this will give you some ideas.
PROCEDURE fn_LOGdata(_pType, cTbl) *-- _pType: type of logging (a-add, d-delete, m-modify) *-- ctbl: the table being logged. The assumption is a log table of the exact same name, but with "z0_" as the 4th, 5th, and 6th characters, exists in the database
*-- if a global variable glnosprun exists, ALL stored procedure code is prevented from executing IF TYPE('m.glnosprun') == "U" LOCAL cLogTbl, tCurrTime, zlog_modtype, zlog_time, zlog_user, table_ref, ctmp m.tCurrTime = DATETIME() m.cLogTbl = "z0_" + ALLTRIM(m.cTbl) SELECT (m.cTbl) SCATTER MEMO MEMVAR
*-- set up values for the log_mod_type, log_time, log_user m.zlog_modtype = _pType m.zlog_time = tCurrTime *-- there may be a better way to get the logged on user... cTmp = SYS(0) m.zlog_user = IIF(ATC('#', cTmp) > 0, UPPER(ALLTRIM(SUBSTR(cTmp, ATC('#', cTmp) + 1))), 'NoNetwork') INSERT INTO (m.cLogTbl) FROM MEMVAR SELECT (m.cTbl) ELSE ENDIF ENDPROC
HTH, -Charlie