Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Stored procedure for edit log
Message
De
20/11/2008 12:46:50
 
 
À
20/11/2008 11:05:28
Information générale
Forum:
Visual FoxPro
Catégorie:
Visual FoxPro et .NET
Versions des environnements
Visual FoxPro:
VFP 9 SP2
OS:
Vista
Network:
Windows 2008 Server
Database:
MS SQL Server
Divers
Thread ID:
01361756
Message ID:
01363243
Vues:
12
>>>>
>>>>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.
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform