19. April 2007 11:15
19. April 2007 12:39
19. April 2007 12:57
19. April 2007 18:32
IF ISCLEAR(ADOConnection) THEN
CREATE(ADOConnection);
ConnectionString := 'Server=' + <Server_Name>;
IF <Trusted> THEN
// Windows Authentication
ConnectionString += ';Trusted_Connection=Yes;'
ELSE
// Database Authentication
ConnectionString += ';Trusted_Connection=no;UID=' + <User_ID> + ';pwd=' + <Passwd> + ';'
CursorLocation := 3; // Client Site
ADOConnection.Provider('SQLOLEDB');
ADOConnection.CursorLocation(CursorLocation);
ADOConnection.ConnectionString(ConnectionString);
ADOConnection.Open;
RecordsAffected := 0;
Options := 1; // Textual Definition
IF ADOConnection.State = 1 THEN BEGIN // connected
ADOConnection.DefaultDatabase(<Database_Name>);
ADOConnection.CommandTimeout(0); // Timeout set to indefinitely
ADORecSet := ADOConnection.Execute(<Statement>, RecordsAffected, Options);
ADOErrors := ADOConnection.Errors();
END;
ADOConnection.Close;
20. April 2007 09:06