Ver Mensaje Individual
  #6  
Antiguo 18-08-2005
m@kio m@kio is offline
Miembro
 
Registrado: may 2005
Posts: 42
Reputación: 0
m@kio Va por buen camino
Yo hize lo sig. para restaurar una BD SQL

Código Delphi [-]
  procedure EjecutarPrograma(rutaPrograma,
     parametros: string; esperar: boolean);
   var
    salida: DWord;
    punteroInfo: PShellExecuteInfo;
    infoEjecucion: TShellExecuteInfo;
   begin
    with infoEjecucion do
    begin
     cbSize := SizeOf(infoEjecucion);
     fMask := SEE_MASK_NOCLOSEPROCESS;
     wnd := GetActiveWindow;
     lpVerb := nil;
     lpFile := PChar(rutaPrograma);
     lpParameters := Pchar(parametros + #0);
     lpDirectory := nil;
     nShow := SW_NORMAL;
     hInstApp := 0;
    end;
    punteroInfo:= @infoEjecucion;
    ShellExecuteEx(punteroInfo);
    if esperar then
     repeat
      salida := WaitForSingleObject(infoEjecucion.hProcess, 500);
      Application.ProcessMessages;
     until (salida <> WAIT_TIMEOUT);
   end;
  
  procedure TForm1.Button1Click(Sender: TObject);
  begin
   EjecutarPrograma('osql','-b -U sa -P -i "'+ExtractFilePath(application.ExeName)+'EsthelDB.sql"',true);
  end;

Donde se manda llamar EjecutarPrograma nada mas es k pongas el comando para ejecutar querys en MySQL, pero creo que esto te puede servir.

Si tienes alguna duda, pues lo comentas y veremos k se puede hacer

Última edición por m@kio fecha: 18-08-2005 a las 00:56:00.
Responder Con Cita