More information.
Test 1:
1. Add a TUniConnection to a form. Manually set the server, user, pass etc and connect.
2. On the form add TUniStoredProc. Attach the stored procedure connection to the TUniConnection.
3. Add a button and in the OnClick add code to setup the TUniStoredProc and execute it.
3. Run the application and click the button.
4. The parameter "pRECID" shows in the watch list, can be set and the proc executes successfully.
Test 2:
1. Add a button to a form. On the button click create an instance of TUniConnection in code UniConnection:= TUniConnection .Create(nil); and set the server, user, pass etc in code and connect. The connect is established as I've tested and can query other data while in the application.
2. From another button click add more code to create an instance of TUniStoreProc and in code set the TUniStoreProc properties and execute.
Code: Select all
UniStoreProc:= TUniStoreProc.Create(nil)
UniStoreProc.Connection:= UniConnection;
UniStoreProc.StoredProcName:= 'spDELETE_Attendance';
UniStoreProc.Prepare;
UniStoreProc.ParamByName('pRECID').AsInteger:= 638;
UniStoreProc.Execute;
UniStoreProc.Free;
I get the same errors as shown in my previous post. This really doesn't make any sense as why this would act differently. I have always created non visual comps like this in code as my application business logic code and db engine code is total divorced from the UI.
Thanks again for any help.