Delphi Programming Projects by William Duarte

Delphi Programming Projects by William Duarte

Author:William Duarte [William Duarte]
Language: eng
Format: epub
Tags: COM051230 - COMPUTERS / Software Development and Engineering / General, COM051000 - COMPUTERS / Programming / General, COM048000 - COMPUTERS / Systems Architecture / Distributed Systems and Computing
Publisher: Packt Publishing
Published: 2019-05-02T12:08:28+00:00


procedure initialize;

begin

If Assigned( DM_RepositorySQLServer ) then

exit;

Application.CreateForm(TDM_RepositorySQLServer, DM_RepositorySQLServer);

end;

Last, but not least, we need to encode the OnCreate event so that the initialize procedure makes sense:

procedure TDM_RepositorySQLServer.DataModuleCreate(Sender: TObject);

begin

Try

FDConnSQLServer.Connected := False;

FDConnSQLServer.Connected := True;

Except

On E : Exception do

ShowMessage('Error Connect SQL Server : ' + E.Message)

End;

end;

It's important to remember that in this step, we can set up the parameters of the database at runtime. In this example, we are only disconnecting and connecting to the current parameters, imputed in step 4 of this section.

In the DataModule class declaration, we will implement our repository interface. This will ensure that DataModule implements the interface methods shown in the next step.

Include the iRepositories interface in the DataModule:



Download



Copyright Disclaimer:
This site does not store any files on its server. We only index and link to content provided by other sites. Please contact the content providers to delete copyright contents if any and email us, we'll remove relevant links or contents immediately.