Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Problem updating tables from Stored Procedure
Message
General information
Forum:
Visual FoxPro
Category:
Other
Environment versions
Visual FoxPro:
VFP 9 SP1
Miscellaneous
Thread ID:
01132012
Message ID:
01132055
Views:
21
Where you read this?
I use SP rarely and i am not aware of this?
Just remove this block from my example and try it w/o error handling.

>>>>What is DataFolder?
>>>>variable or hardcoded path to Data?
>>>
>>>It is a variable and I test it within the SP which points to the right folder. In fact, I can read the values from the tables all right. So the table must be opening in the right folder. The problem is that no values are not being written to the table and no new records are inserted. And no error message. Although error message is a moot point since it is hard to trap error in a stored procedure.
>>
>>OK, try this:
>>
>>LOCAL lcOldPath
>>lcOldPath = SET([PATH])
>>SET PATH TO
>>WAIT WINDOW FILE([MyTable.DBF]) && Just to make sure you open table in m.DataFolder
>>TRY
>>   USE (m.DataFolder + "mytable") IN 0 ALIAS MYTABLE AGAIN SHARED
>>   INSERT INTO MyTable (MyField) VALUES ([ABC])
>>CATCH TO oExcpt
>>   MessageBox([Error happened ]+oExcpt.Message)
>>ENDTRY
>>USE IN MyTable
>>SET PATH TO (lcOldPath)
>>
>
>Unfortunately you cannot use TRY/CATCH/ENDTRY in VFP Stored Procedure.
>
>Thank you for your suggestion and code.
Against Stupidity the Gods themselves Contend in Vain - Johann Christoph Friedrich von Schiller
The only thing normal about database guys is their tables.
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform