TMSStoredProc.Disconnected
Posted: Fri 16 Nov 2012 18:51
Hello:
The property helps Disconnected says:
"Set the Disconnected property to True to keep dataset opened after connection is closed. "
But I can not stay the Open DataSet when connection is closed.
procedure TfrmCampos_Descripcion.LlenaDatosForma;
var
Conexion : TConexion; <- Class to handle the connection
begin
StProc.Close;
Conexion := TConexion.Create;
Conexion.Abrir; <- Open Connection
try
with Conexion do
begin
StProc.Close; <- StProc is TMSStoredProc
StProc.Connection := Conexion;
StProc.Disconnected := True; <- Dataset indicated that stays open
StProc.StoredProcName := 'PA_CONSULTAS_CAMPOS_DESCRIPCION';
StProc.Params.ParamByName('PMENU').Value := 'FILL_CAMPOS_DESC_GRD';
StProc.Params.ParamByName('ID_CAMPO_DESC').Value := -1;
StProc.Params.ParamByName('GIRO').Value := -1;
StProc.Open;
end;
finally
Conexion.Cerrar; <- Close Conection
Conexion.Free;
end;
end;
The property helps Disconnected says:
"Set the Disconnected property to True to keep dataset opened after connection is closed. "
But I can not stay the Open DataSet when connection is closed.
procedure TfrmCampos_Descripcion.LlenaDatosForma;
var
Conexion : TConexion; <- Class to handle the connection
begin
StProc.Close;
Conexion := TConexion.Create;
Conexion.Abrir; <- Open Connection
try
with Conexion do
begin
StProc.Close; <- StProc is TMSStoredProc
StProc.Connection := Conexion;
StProc.Disconnected := True; <- Dataset indicated that stays open
StProc.StoredProcName := 'PA_CONSULTAS_CAMPOS_DESCRIPCION';
StProc.Params.ParamByName('PMENU').Value := 'FILL_CAMPOS_DESC_GRD';
StProc.Params.ParamByName('ID_CAMPO_DESC').Value := -1;
StProc.Params.ParamByName('GIRO').Value := -1;
StProc.Open;
end;
finally
Conexion.Cerrar; <- Close Conection
Conexion.Free;
end;
end;