Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Stored procedure for edit log
Message
From
20/11/2008 12:46:50
 
 
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:
01363243
Views:
11
>>>>
>>>>Hi Viv,
>>>>
>>>>I don't think this
>>>>
>>>>command.CommandText = "SetUserName('" + sUser + "')";
>>>>
>>>>is going to work.
>>>
>>>Hi,
>>>Why not?
>>
>>May be I'm wrong, but I think in CommandText you can only specify the SP name and you have to pass your parameter through Parameters collection of the Command object.
>
>Worked for me :=}

Hey there!!! I found a way to do it!! The germ of the idea came from Viv's comment about passing a parameter in the update command. Here's how it works.
1. The table being updated gets a new field "editedby" to act as a temporary place to hold the name of the user performing the update.
2. The username is passed to the table being updated as part of the standard update command and is placed in the EDITEDBY field. The update command receives the value of the username as a session parameter.
3. The stored proc knows the value it wants for the public variable has not been initialized so it initializes the variable and obtains the value from the table being updated.
I've done the code and it works.
Thanks to all of you who helped think through this.
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform