Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Stored procedure for edit log
Message
From
17/11/2008 16:57:04
 
General information
Forum:
Visual FoxPro
Category:
Visual FoxPro and .NET
Environment versions
Visual FoxPro:
VFP 9 SP2
OS:
Vista
Network:
Windows 2008 Server
Database:
MS SQL Server
Miscellaneous
Thread ID:
01361756
Message ID:
01362376
Views:
13
>>>Hi Viv,
>>>
>>>It doesn't ring a bell for me. I'll look this weekened anyway.
>>
>>I can't remember the exact scenario but I remember posting code that would set a public variable for use by VFPOLEDB.....
>>Best,
>>Viv
>
>Hi Viv,
>
>I guess you meant this one Re: Pass a web variable to a stored procedure Thread #1257541 Message #1258431

Thanks Viv,
and
Thanks Naomi. Your memory and search ability is amazing. I truly do get embarrassed when an answer to a question turns up to be one of my previous threads. (This may actually be my 3rd go at this. In the prior case I learned how to solve the previous problem but not enough to carry it forward to my new situation. Let's review and see if it will work in the new environment. The assignment is to create an edit log that preserves date, user, old and new values, etc. The code to do this is in a stored procedure that executes via INSERT and UPDATE triggers. The reason it is by trigger is that the edits may happen any one of 3 ways, the VFP UI Browse, the VFP application, the web (.NET). So the SP looks like this
func SaveHistory()
lparam lcTriggerType
** more code and  do the save etc
INSERT INTO historylog (editdate,user,etc) values (datetime(),gcUserName,etc)
and the triggers look like this:
*Update Trigger
SaveHistory("U")
*Insert Trigger
SaveHistory("I")
This works fine from the VFP side. Now lets go to the NET side. We have an SqlDatasource using an OLEDB connection, and a Formview using the SqlDatasource. The user clicks the Formview into edit mode,makes the edits, and then clicks Save/Update which fires the SqlDataSource UpdateCommand. Assuming I can programmatically define the UpdateCommand, how can I embed the value of Session("User") so that the SP can see it?
Note that the SP is not fired from NET. It is fired inside VFP by the trigger.
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform