Parameters Access on Design Time

Discussion of open issues, suggestions and bugs regarding UniDAC (Universal Data Access Components) for Delphi, C++Builder, Lazarus (and FPC)
Post Reply
derekwildstar
Posts: 32
Joined: Sun 01 Apr 2012 14:12
Location: Olinda / PE / Brasil
Contact:

Parameters Access on Design Time

Post by derekwildstar » 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:
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.
I decided, so, to make a clean test, as follows:
  1. Open my old BDE project and convert it to UniDAC
  2. All TUniStoredProc have the parameters correctly assigned and acessible on designtime
  3. The TUniConnection has 99% of the properties correctly assigned, so I fill the remaining properties and connect the TUniConnection at design time
  4. All the linked TUniStoredProc have no parameters anymore, but inside the DFM they are, just like AlexP said!
  5. I disconnected on designtime the TUniConnection
  6. All the linked TUniStoredProc stays without parameters, but inside the DFM they are!
  7. Close and reopen the Delphi IDE. Result: nothing change.
Well, as you can see, the parameters are inside the dfm and surely I can use then at runtime, but there are no way to use these params on designtime, so I cannot set default values for parameters.

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?

AlexP
Devart Team
Posts: 5530
Joined: Tue 10 Aug 2010 11:35

Re: Parameters Access on Design Time

Post by AlexP » Fri 04 May 2012 10:27

hello,

We have checked the behaviour of MigrationWizard, and all the parameters are saved and displayed correctly after converting/saving/reopening the project in TuniStoredProc. Please send your *.Pas and *.dfm files with BDE components to alexp*devart*com in order that we can check the MigrationWizard functioning once more on your real data

derekwildstar
Posts: 32
Joined: Sun 01 Apr 2012 14:12
Location: Olinda / PE / Brasil
Contact:

Re: Parameters Access on Design Time

Post by derekwildstar » Fri 04 May 2012 13:07

Hello AlexP!

Before I send the pas/dfm, I must explain that the problem is not directly related to Migration Wizard (sorry my insufficient explanation). I used this example because it was the first time I've seen. The Migration Wizard was used on my work.

At home, I've made a simple test with TUniDAC and PostGres, without use the MW and the parameters was lost the same way. I will make a test with PostGres, right? It's more simple to me instead to use the MW on a large BDE project.

I'll send it soon to your e-mail.

Staty tuned ;)

Thank you for your effort!

derekwildstar
Posts: 32
Joined: Sun 01 Apr 2012 14:12
Location: Olinda / PE / Brasil
Contact:

Re: Parameters Access on Design Time

Post by derekwildstar » Fri 04 May 2012 14:09

AlexP, I sent you an e-mail

Thank you!

AlexP
Devart Team
Posts: 5530
Joined: Tue 10 Aug 2010 11:35

Re: Parameters Access on Design Time

Post by AlexP » Mon 07 May 2012 11:13

hello,

Thank you, I've received your example, however, after performing the steps you have provided (1...9), the saved parameters are present in the Params tab, and as I wrote you before, the text of the procedure call itself cannot be saved. Maybe the problem is due to IDE settings.
P.S. please specify the exact version of your IDE, I've tested your sample on Delphi 2009 12.0.3420.21218, and the latest UniDAC 4.1.6

derekwildstar
Posts: 32
Joined: Sun 01 Apr 2012 14:12
Location: Olinda / PE / Brasil
Contact:

Re: Parameters Access on Design Time

Post by derekwildstar » Mon 07 May 2012 13:38

Hello AlexP

I tested this behaviour on two IDE. At work, BDS 2006 and at home ERS XE. On both the same problem occurs. The parameters are saved on DFM but not shown on parameters tab. You said on your test everything was OK, so, can you copy and paste here the DFM part of component? Here is the mine:

Code: Select all

object UNSP: TUniStoredProc
    StoredProcName = 'idu_usuarios2'
    Connection = UNCN
    Left = 414
    Top = 36
    ParamData = <
      item
        DataType = ftString
        Name = 'pmodo'
        ParamType = ptInput
        Value = 'xxx'
      end
      item
        DataType = ftSmallint
        Name = 'psm_usuarios_id'
        ParamType = ptInput
      end
      item
        DataType = ftString
        Name = 'pva_nome'
        ParamType = ptInput
      end
      item
        DataType = ftString
        Name = 'pva_login'
        ParamType = ptInput
      end
      item
        DataType = ftString
        Name = 'pch_senha'
        ParamType = ptInput
      end
      item
        DataType = ftString
        Name = 'pva_email'
        ParamType = ptInput
      end
      item
        DataType = ftBoolean
        Name = 'pbo_superusuario'
        ParamType = ptInput
      end>
    CommandStoredProcName = 'idu_usuarios2'
  end
There are any other test that I can do for you? This problem is very annoying

AlexP
Devart Team
Posts: 5530
Joined: Tue 10 Aug 2010 11:35

Re: Parameters Access on Design Time

Post by AlexP » Tue 08 May 2012 12:35

hello,

This problem can be reproduced only on the UniDAC version 4.1.5. As I wrote before, all parameters saved in dfm are displayed correctly in the current version 4.1.6. Please update your UniDAC version

derekwildstar
Posts: 32
Joined: Sun 01 Apr 2012 14:12
Location: Olinda / PE / Brasil
Contact:

Re: Parameters Access on Design Time

Post by derekwildstar » Tue 08 May 2012 13:55

Humm... OK!

I'll talk to my boss ;)

But he will not be very happy, since recently bought a license 4.1.5. This new version should be paid again?

AlexP
Devart Team
Posts: 5530
Joined: Tue 10 Aug 2010 11:35

Re: Parameters Access on Design Time

Post by AlexP » Tue 08 May 2012 14:22

Hello,

A purchased subscription is active for a year, and you can download all the new versions for free during this period. You can check a version available for you at the Register User Area page (using the credentials received after purchasing the product)

derekwildstar
Posts: 32
Joined: Sun 01 Apr 2012 14:12
Location: Olinda / PE / Brasil
Contact:

Re: Parameters Access on Design Time

Post by derekwildstar » Tue 08 May 2012 16:05

Ok!! Thank You!!

derekwildstar
Posts: 32
Joined: Sun 01 Apr 2012 14:12
Location: Olinda / PE / Brasil
Contact:

Re: Parameters Access on Design Time

Post by derekwildstar » Fri 11 May 2012 18:13

Hello!

We received today the new UniDAC version (4.1.6). Here we use a custom folder structure, so, we've done some file replacements with the updated ones. The parameters display on designtime was solved but into this process I could see that some corrections were not implemented. Take a look:

ASEClassesUni.pas

This unit was not updated anyway. This means that the return parameter will not be useable when the provider is ASE, so this unit was not replaced by the "new" one.

ODBCClassesUni.pas

This unit was not updated to solve the problem of procedure call generation, so this unit was not replaced by the "new" one. See the TODBCCommand.CreateProcCall

AlexP
Devart Team
Posts: 5530
Joined: Tue 10 Aug 2010 11:35

Re: Parameters Access on Design Time

Post by AlexP » Mon 14 May 2012 11:54

Hello,

We have made changes in generation of the stored procedure call string on 19.04.2012, and the latest UniDAC version 4.1.6 was released on 02.04.2012, therefore this fixes will be included in the next version only. Untill the release, you should fix this files manually.

derekwildstar
Posts: 32
Joined: Sun 01 Apr 2012 14:12
Location: Olinda / PE / Brasil
Contact:

Re: Parameters Access on Design Time

Post by derekwildstar » Mon 14 May 2012 12:51

OK! No problem! Thank you!

Post Reply