Ver Mensaje Individual
  #2  
Antiguo 20-11-2006
alfil123 alfil123 is offline
Miembro
 
Registrado: nov 2005
Posts: 116
Reputación: 19
alfil123 Va por buen camino
Question

he probado un codigo del hilo este codigo
procedure TFormMenu.Productos2Click(Sender: TObject);
var
j: Integer;
begin
try
Excel := CreateOleObject('Excel.Application');
except
Excel.Quit;
showmessage('No se pudo crear el Objecto Excel.');
raise;
end;
if OpenDialogXls.Execute then Archivo:= OpenDialogXls.FileName
else exit;
Excel.Workbooks.Open(Archivo);
j:= 2;
try
repeat
with InsertarProductos do
begin
Close;
Parameters.ParamByName('@codplu').Value:= Excel.Cells[j,1].Value;
Parameters.ParamByName('@codtrasval').Value:= Excel.Cells[j,2].Value;
Parameters.ParamByName('@codfabricante').Value:= Excel.Cells[j,3].Value;
Prepared:= True;
ExecProc;
end;
inc(j);
until Excel.Cells[j,2].Value = '';
Excel.quit;
ShowMessage(' El fichero de productos ha sido importado exitosamente');
except
ShowMessage(' !!!!! ATENCION !!!!! ' + chr(13) +
' El fichero no pudo ser importado' + chr(13) +
' Revise bien su estructura');
end;
end;


pero da el caso que es hacia sql server y esta linea no me corre
OpenDialogXls.Execute then Archivo:= OpenDialogXls.FileName
OpenDialogXls no es reconocido por el compilador, nose me esta faltando alguna libreria
Responder Con Cita