Parameters Access on Design Time
Posted: Tue 01 May 2012 17:03
I decided to open this new topic, based on a secondary issue discovered on a old topic (http://forums.devart.com/viewtopic.php?f=28&t=23856) to expose it to more people. Let's go...
I used the Migration Wizard to convert my old BDE project to UniDAC. All conversion was successfull. After that I've saw one TUniStoredProc and the params was all automatically filled. The command in the format {? = call procedure name (?,?)} (ODBC call format) was generated automatically also.
After close the project, close the Delphi IDE and open everything again, all parameters and the generated command has gone. Although the lack of these things the program works correctly, but i cannot set the parameters on design time.
AlexP, from Devart Team said the following:
This seems to be related with the dynamically generated comand {? = call procedure name (?,?)}. At first, after the conversion, all the procedures are processed and the corresponding command is generated with parameter names assigned like ":param1, :param2, etc.", so, the parameters are acessible at design time by property editor.
After connect, this command is lost somehow and so the parameters are also lost, but this affects only the access by property editor because all the params are available at run time. All the parameters remains saved into DFM, but I can't change them because the property editor don't show them.
This behaviour was checked on a application with Sybase ASE after conversion from BDE to UniDAC and another application with PostgreSQL using UniDAC since the begin (without any conversion), so this problem (this is a problem, right?) is not Database/Driver dependent.
This behaviour is correct? This is normal in UniDAC?
I used the Migration Wizard to convert my old BDE project to UniDAC. All conversion was successfull. After that I've saw one TUniStoredProc and the params was all automatically filled. The command in the format {? = call procedure name (?,?)} (ODBC call format) was generated automatically also.
After close the project, close the Delphi IDE and open everything again, all parameters and the generated command has gone. Although the lack of these things the program works correctly, but i cannot set the parameters on design time.
AlexP, from Devart Team said the following:
I decided, so, to make a clean test, as follows:When saving *.dfm, the text of the procedure call is not saved itself, only the name and parameters are saved. Please check the *.dfm file after closing Delphi. There must be all procedure methods in the object YourStoredProc: TUniStoredP section.
- Open my old BDE project and convert it to UniDAC
- All TUniStoredProc have the parameters correctly assigned and acessible on designtime
- The TUniConnection has 99% of the properties correctly assigned, so I fill the remaining properties and connect the TUniConnection at design time
- All the linked TUniStoredProc have no parameters anymore, but inside the DFM they are, just like AlexP said!
- I disconnected on designtime the TUniConnection
- All the linked TUniStoredProc stays without parameters, but inside the DFM they are!
- Close and reopen the Delphi IDE. Result: nothing change.
This seems to be related with the dynamically generated comand {? = call procedure name (?,?)}. At first, after the conversion, all the procedures are processed and the corresponding command is generated with parameter names assigned like ":param1, :param2, etc.", so, the parameters are acessible at design time by property editor.
After connect, this command is lost somehow and so the parameters are also lost, but this affects only the access by property editor because all the params are available at run time. All the parameters remains saved into DFM, but I can't change them because the property editor don't show them.
This behaviour was checked on a application with Sybase ASE after conversion from BDE to UniDAC and another application with PostgreSQL using UniDAC since the begin (without any conversion), so this problem (this is a problem, right?) is not Database/Driver dependent.
This behaviour is correct? This is normal in UniDAC?