Jump to content

error : Connection and ConnectionName property values are both empty


Recommended Posts

Posted

Hello all,

 

Please help.

 

I am using Anydac component (TAdConnection and TADquery)

 

Unigui 0.93.0.996

 

 

TADConnection is put in MainModule

 

TADQuery and Tdatasource is put in MainForm.

 

TADQuery is set active to True at design time. (cause exception error in webmode)

 

the program works in VCL mode.

 

post-930-0-90851700-1368064494_thumb.gif

 

But it raise an exception error if the program is run in WebMode.

 

post-930-0-24299400-1368064504_thumb.gif

 

the problem is solved if TADQuery is set Active to False and set to true at runntime.

 

But I prefer TADQuery is active at design time.

How can I solve the problem ?

 

Thanks

Hendra

Posted

If you don't want to wait a bugfix: easy way to solve it - open your Query OnFormCreate, or OnFormShow)).

 

Yes, thanks.

 

actually it also occurs in desktop application.

to solve this in desktop application, I manually change the create order of the data module - and set it to be the first form that gets created by the application.

 

Auto-creat forms :

   Datamodule --> arrange the datamodule to be created first before mainform

   Mainform

Posted

If you don't want to wait a bugfix: easy way to solve it - open your Query OnFormCreate, or OnFormShow)).

 

 set the dataset connection property in  onbeforeopen event can solve the problem

 

code

procedure TMainForm.qryTable1BeforeOpen(DataSet: TDataSet);
begin
  if TADQuery(DataSet).Connection = Nil then
    TADQuery(Dataset).Connection:= UniMainModule.ADConnection1;
end;

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...