Witam
Piszę baze danych i chciałbym żeby przy użyciu klienta w sieci Lan z innego kompa mógł połączyc sie po IP z baza i przegłądac baze
klienta juz mam wykorzystałem clientsocket i server socket ok łacze sie z bazą przy uzyciu tej procedurki moge dodac wpis ale nie mam pojecia jak przeglądac baze
krótko pisząc gdy połącze sie z serverem na którym jest dbgrid z wpisami chciałbym widziec te wpisy w dbgridzie na cliencie
var
Data: TStringList;
I: Integer;
begin
// activate the connection
ClientSocket1.Address := EditServer.Text;
ClientSocket1.Active := True;
Application.ProcessMessages;
// save database data in a string list
Data := TStringList.Create;
try
table1.First;
while not Table1.Eof do
begin
// if the record is still not logged
if Table1CompID.IsNull or (Table1CompId.AsInteger = 0) then
begin
lbLog.Items.Add ('Sending ' + Table1Company.AsString);
Data.Clear;
// create strings with structure "FieldName=Value"
for I := 0 to Table1.FieldCount - 1 do
Data.Values [Table1.Fields[I].FieldName] :=
Table1.Fields [I].AsString;
// send the record
ClientSocket1.Socket.SendText (Data.Text);
// wait for reponse
fWaiting := True;
while fWaiting do
Application.ProcessMessages;
end;
Table1.Next;
end;
finally
// free the data and close the connection
Data.Free;
ClientSocket1.Active := False;
end;
end;
dziekuje za podpowiedzi
pozdrawiam