Get Design-Time Data is driving me insane

Yet again I’m struggling with the Get Design-Time Data option on my tables. I need to do this before I can populate columns in grid components and the like from the data table but getting it to actually work is a nightmare.

I have re-usable data modules which contain my TDAMemDataTables. These can be used by either the server or the client, using a local or remote data adapter respectively. At design-time, the tables have a local data adapter set. When working on the server in the IDE, the design-time data option works fine. It’s the client that’s the problem.

In the client, at runtime the RemoteDataAdapter property of the tables is set to a remote data adapter. This all works fine at runtime but causes big problems at designtime. First I have to change the data adapter to a remote one but then it still won’t work as it’s trying to open the table which needs to talk to the server. This requires authentication but I’m using a customised authentication system which won’t work at design-time in the IDE.

Why does the table need to even be opened? The fields have already been populated from the schema via Retrieve DataTable Schema - why is any further information required from the server? The schema fields contain all the information necessary to generate the design-time data so I can populate grid columns in other components.

This is seriously frustrating, is there a simpler way of getting this to work?

I’ve found the old article on design-time login but I can’t figure out how to make use of this.

If I change the data adapter to my client’s remote one then, if I try to open the table, I get a ‘session not found’ error immediately. What am I doing wrong? How do I get the client to trigger the authentication in the IDE?

it can be a reason for such failure.

DA uses standard Delphi DB infrastructure that is required filled fields in TDataset.
of course, it has no reason to recreate all those fields in internal TDataset component at every change in TDADataTable so these fields are created only at opening TDADataTable.
You can open any tables on client-side without any requests to server if table.RemoteFetchEnabled is set to false.

so workaround for your case can be:

  • set RemoteFetchEnabled in design-time to False
  • set this property to True before table is opened in run-time.
1 Like

Ah ok thanks, so you reckon if I set the RemoteFetchEnabled to false and then open the table, the Get Design-Time Data function should work?

Out of interest, how do I get the IDE logon thing to work/trigger? If that popped up when I tried to open the table then I could use it to authenticate to the server.

no, it won’t show any data. however table [and internal dataset] will be opened so DB controls like DBGrid can be configured properly

for simple authorizations, it can be enough to specify TargetURL/UserName/Password inside RDA.

for Relativity, LoginString should be used instead of UserName/Password:

1 Like