Do you have a code snippet to show the syntax I need to get started with IntraWeb?
I get the message that CoInitialize has not been called, although I have included that as:
CoInitialize(nil);
Where should that go in my code?
Delphi 7 + IntraWeb 7 trial.
Thanks,
Steve.
CoInitialize with IntraWeb
Position of CoInitialize
Many thanks for you help.
I have written this code snippet and called CoInitialize in the main form create event. Then set my connection string. A grid does populate from the table.
procedure TIWForm1.IWAppFormCreate(Sender: TObject);
begin
CoInitialize(nil);
myConnection.ConnectString:='Data Source=SERVER;Initial Catalog=Equity;Integrated Security=SSPI';
myConnection.Connected:=True;
MSTable1.Active:=True;
end;
Is this the correct way to do it?
Where should I call CoUnInitialize?
Do I have to do this for every form in my web application?
Thanks,
Steve.
I have written this code snippet and called CoInitialize in the main form create event. Then set my connection string. A grid does populate from the table.
procedure TIWForm1.IWAppFormCreate(Sender: TObject);
begin
CoInitialize(nil);
myConnection.ConnectString:='Data Source=SERVER;Initial Catalog=Equity;Integrated Security=SSPI';
myConnection.Connected:=True;
MSTable1.Active:=True;
end;
Is this the correct way to do it?
Where should I call CoUnInitialize?
Do I have to do this for every form in my web application?
Thanks,
Steve.
I found a more elegant solution as the whole problem originated from using Intraweb, I rather get Intraweb to initialise com for me. This sorts it out nicely.
When using your MS SQL DbExpress driver or ADO driver with Intraweb, you must set the ComInitialization property in the ServerController to ‘ciMultiThreaded’.
This will eliminates the "CoInitialize has not been called" error.
When using your MS SQL DbExpress driver or ADO driver with Intraweb, you must set the ComInitialization property in the ServerController to ‘ciMultiThreaded’.
This will eliminates the "CoInitialize has not been called" error.