program Project10;
{$APPTYPE CONSOLE}
uses
SysUtils,
adodb,
db,
ActiveX;
var
Conn: TAdoConnection;
AdoQuery1: TAdoQuery;
begin
CoInitialize(nil);
try
Conn := TAdoConnection.Create(nil);
try
conn.ConnectionString :=
'Provider=SQLNCLI10.1;' +
'Integrated Security=SSPI;' +
'Persist Security Info=False;' +
'User ID="";' +
'Initial Catalog=SELA;' +
'Data Source=MyDireccionIP;' +
'Initial File Name="";' +
'Server SPN=""';
conn.Open();
AdoQuery1 := TAdoQuery.Create(nil);
try
AdoQuery1.Connection := Conn;
AdoQuery1.CursorLocation := clUseServer;
AdoQuery1.CursorType := ctOpenForwardOnly;
AdoQuery1.SQL.Text := 'select * from PARAMETROS';
AdoQuery1.Open;
WriteLn('Numero de registros: ', AdoQuery1.RecordCount);
AdoQuery1.Close;
finally
AdoQuery1.Free;
end;
finally
Conn.Free;
end;
ReadLn;
except
on E: Exception do
Writeln(E.ClassName, ': ', E.Message);
end;
end.