var
Server, Kull, Sifre,DB:
String;
Port: Integer;
MyForm:TCLForm;
qrySql : TClSqlQuery;
clProGrid:TCLProGrid;
procedure
MainForm;
begin
MyForm :=
TCLForm.Create(Self);
qrySql :=
TClSqlQuery.Create(Nil);
try
qrySql.Connection:=
Clomosy.DBSQLServerConnection;
qrySql.Sql.Text:= 'SELECT *FROM ATBLPROGPRMLOG';
qrySql.Open;
if
qrySql.Found then
begin
clProGrid := MyForm.AddNewProGrid(MyForm,'ClProGrid4');
clProGrid.BeginUpdate;
clProGrid.NormalLayoutFillColor := clAlphaColor.clHexToColor('#ebf3ff');
clProGrid.NormalLayoutFontColor := clAlphaColor.clWhite;
clProGrid.FixedLayoutFillColor
:= clAlphaColor.clBlue;
clProGrid.FixedLayoutFontColor := clAlphaColor.clWhite;
clProGrid.SelectedLayoutFillColor
:= clAlphaColor.clHexToColor('#a8c2ff');
clProGrid.SelectedLayoutFontColor := clAlphaColor.clWhite;
clProGrid.FocusedLayoutFillColor
:= clAlphaColor.clHexToColor('#a8c2ff');
clProGrid.FocusedLayoutFontColor := clAlphaColor.clWhite;
clProGrid.Align
:= alContents;
clProGrid.Options.Selection.Mode
:= smSingleRow;//smSingleRow VEYA smSingleColumn VEYA smNone
clProGrid.Options.ColumnSize.Stretch
:= True;
clProGrid.ConnectDataSet(qrySql);
//
clProGrid.HorzAlignments[3, 3] := 2;
clProGrid.Colors[3, 3] := clAlphaColor.clYellow;
clProGrid.FontStyles[5,3] := 1;
clProGrid.EndUpdate;
end;
except
ShowMessage('[01] Exception Class: '+LastExceptionClassName+' Exception
Message: '+LastExceptionMessage);
end;
//qrySql.Free;
MyForm.Run;
end;
begin
try
try
Server := '192.168.5.24';
Kull := 'sa';
Sifre := 'Axoft';
DB := 'BITIM23';
Port := 50000;
Clomosy.EventLog := True;
if not Clomosy.DBSQLServerConnect('SQL Server', Server, Kull, Sifre, DB,
Port) then
begin
ShowMessage('DATABASE CONNECT ERROR');
Exit;
end;
MainForm;
except
ShowMessage('Connection Error '+'Exception Class: '+LastExceptionClassName+'
Exception Message: '+LastExceptionMessage);
end
finally
end;
end
|