PDA

Ver la Versión Completa : problemas con la ejecucion de mi aplicacion en delphi


mikylin
13-12-2007, 16:03:03
hola amigos del foro:

tengo un problema cuando ejecuto mi aplicacion en delphi 7 me sale el siguiente error

Project Project1.exe1 raised exception class EVariant TypeCastError with message 'Cold not convert variant of type (Null) into type (String)'. Process Stopped. Use Step or Run to Continue.

lo vuelvo a ejecutar y me vuelve a dar ese error. Lo ejecuto varias veces y al final de 15 o 16 intentos recien corre el programa

Por favor les pido una ayudita. Gracias:confused:

Caral
13-12-2007, 17:22:22
Hola
Tienes un problema en el codigo, en algun sitio estas haciendo una trasformacion de Variant a String y no la acepta.
Coloca el codigo aqui, usa el depurador ( F7 o F8) asi veras donde da el error.
Saludos

mikylin
13-12-2007, 20:30:32
cuando lo depuro solo me marca los end. , la ultima fila de cada formulario y en ninguna parte aparece la palabra variant.

por favor una manito.

Caral
13-12-2007, 20:33:30
Hola
La palabra variant no te va a salir en ningun lado.
Coloca el codigo que te da problemas aqui y lo vemos.
Saludos

mikylin
13-12-2007, 21:44:39
hola caral:
este es uno de los formularios en los que al depurar me sale la ultima fila resaltada.


unit R_IVPIF;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, QRCtrls, jpeg, QuickRpt, ExtCtrls;
type
TRIVPIF = class(TForm)
QuickRep1: TQuickRep;
PageHeaderBand1: TQRBand;
TitleBand1: TQRBand;
ColumnHeaderBand1: TQRBand;
DetailBand1: TQRBand;
PageFooterBand1: TQRBand;
QRLabel2: TQRLabel;
QRImage2: TQRImage;
QRSysData1: TQRSysData;
QRShape1: TQRShape;
QRLabel8: TQRLabel;
QRLabel12: TQRLabel;
QRLabel4: TQRLabel;
QRLabel5: TQRLabel;
QRLabel6: TQRLabel;
QRLabel7: TQRLabel;
QRLabel9: TQRLabel;
QRLabel11: TQRLabel;
QRLabel10: TQRLabel;
QRLabel3: TQRLabel;
QRLabel1: TQRLabel;
QRDBText1: TQRDBText;
QRDBText2: TQRDBText;
QRDBText3: TQRDBText;
QRDBText4: TQRDBText;
QRDBText5: TQRDBText;
QRDBText6: TQRDBText;
QRDBText7: TQRDBText;
QRDBText8: TQRDBText;
QRDBText9: TQRDBText;
QRDBText10: TQRDBText;
QRDBText11: TQRDBText;
QRLabel13: TQRLabel;
QRLabel14: TQRLabel;
QRLabel15: TQRLabel;
QRLabel16: TQRLabel;
QRLabel17: TQRLabel;
QRDBText12: TQRDBText;
QRLabel18: TQRLabel;
QRLabel19: TQRLabel;
QRLabel20: TQRLabel;
QRDBText13: TQRDBText;
QRDBText14: TQRDBText;
QRDBText15: TQRDBText;
private
{ Private declarations }
public
{ Public declarations }
end;
var
RIVPIF: TRIVPIF;
implementation
{$R *.dfm}
USES MODULOENLACE;
end.


gracias.

Caral
13-12-2007, 21:52:07
Hola
Usa las etiquetas delphi, se vera mejos asi:

unit R_IVPIF;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, QRCtrls, jpeg, QuickRpt, ExtCtrls;
type
TRIVPIF = class(TForm)
QuickRep1: TQuickRep;
PageHeaderBand1: TQRBand;
TitleBand1: TQRBand;
ColumnHeaderBand1: TQRBand;
DetailBand1: TQRBand;
PageFooterBand1: TQRBand;
QRLabel2: TQRLabel;
QRImage2: TQRImage;
QRSysData1: TQRSysData;
QRShape1: TQRShape;
QRLabel8: TQRLabel;
QRLabel12: TQRLabel;
QRLabel4: TQRLabel;
QRLabel5: TQRLabel;
QRLabel6: TQRLabel;
QRLabel7: TQRLabel;
QRLabel9: TQRLabel;
QRLabel11: TQRLabel;
QRLabel10: TQRLabel;
QRLabel3: TQRLabel;
QRLabel1: TQRLabel;
QRDBText1: TQRDBText;
QRDBText2: TQRDBText;
QRDBText3: TQRDBText;
QRDBText4: TQRDBText;
QRDBText5: TQRDBText;
QRDBText6: TQRDBText;
QRDBText7: TQRDBText;
QRDBText8: TQRDBText;
QRDBText9: TQRDBText;
QRDBText10: TQRDBText;
QRDBText11: TQRDBText;
QRLabel13: TQRLabel;
QRLabel14: TQRLabel;
QRLabel15: TQRLabel;
QRLabel16: TQRLabel;
QRLabel17: TQRLabel;
QRDBText12: TQRDBText;
QRLabel18: TQRLabel;
QRLabel19: TQRLabel;
QRLabel20: TQRLabel;
QRDBText13: TQRDBText;
QRDBText14: TQRDBText;
QRDBText15: TQRDBText;
private
{ Private declarations }
public
{ Public declarations }
end;
var
RIVPIF: TRIVPIF;
implementation
{$R *.dfm}
USES MODULOENLACE;
end.
ahora a pensar.
Saludos

Caral
13-12-2007, 21:55:42
Hola
Aqui no hay nada, solo que usas un MODULOENLACE.
No me dice nada.
Saludos

mikylin
14-12-2007, 13:37:26
Hola Caral aca me sale el error: haber si con esto me puedes ayudar por favor. El programa corre pero se ven feo los errores y no se si mas adelante me de problemas.


unit PRINCIPAL;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls, jpeg, ExtCtrls, XPMan, Menus, Grids, DBGrids, Mask,
DBCtrls;
type
Tmenucito = class(TForm)
XPManifest1: TXPManifest;
DBGrid1: TDBGrid;
DBGrid2: TDBGrid;
DBGrid3: TDBGrid;
DBGrid4: TDBGrid;
DBGrid5: TDBGrid;
DBGrid6: TDBGrid;
DBGrid7: TDBGrid;
DBGrid8: TDBGrid;
DBGrid9: TDBGrid;
Image1: TImage;
Button1: TButton;
Edit1: TEdit;
Edit2: TEdit;
Label1: TLabel;
Label2: TLabel;
Label3: TLabel;
DBGrid10: TDBGrid;
DBEdit1: TDBEdit;
DBEdit2: TDBEdit;
DBGrid11: TDBGrid;
DBEdit3: TDBEdit;
DBEdit4: TDBEdit;
Image2: TImage;
DBEdit5: TDBEdit;

procedure Button1Click(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
menucito: Tmenucito;

implementation
uses
FORMULARIOMENU,MODULOENLACE;
{$R *.dfm}procedure Tmenucito.Button1Click(Sender: TObject);
begin
with datamodule1.BCONTRA_LOGIN do begin
if active=true then active:=false;prepare;
parambyname('@LOGINU').AsString:= EDIT1.TEXT;
parambyname('@CONTRASENAU').AsString:= EDIT2.TEXT;
execproc; active:=true;
end;
with datamodule1.BNOMBREUSUARIO do begin
if active=true then active:=false;prepare;
parambyname('@LOGINU').AsString:= EDIT1.TEXT;
execproc; active:=true;
end;
IF (DBEDIT1.TEXT = '')OR(DBEDIT2.TEXT = '') THEN
begin
SHOWMESSAGE('EL NOMBRE DE USUARIO O CONTRASEÑA NO ES VALIDO');
image2.Visible:=true;
end
ELSE
begin
if (DBEDIT5.TEXT = 'ADMINISTRADOR') then
BEGIN
FPRINCIPAL.SHOW;
image2.Visible:=false;
FPRINCIPAL.MainMenu1.ITEMS.Items[0].ENABLED:=TRUE;
FPRINCIPAL.MainMenu1.ITEMS.Items[2].ENABLED:=TRUE;
FPRINCIPAL.MainMenu1.ITEMS.Items[1].ITEMS[2].ENABLED:=TRUE;

END
ELSE
BEGIN
FPRINCIPAL.SHOW;
FPRINCIPAL.MainMenu1.ITEMS.Items[0].ENABLED:=FALSE;
FPRINCIPAL.MainMenu1.ITEMS.Items[2].ENABLED:=FALSE;
FPRINCIPAL.MainMenu1.ITEMS.Items[1].ITEMS[2].ENABLED:=FALSE;
END;
end;
end;

end.

Caral
14-12-2007, 16:38:53
Hola
Que clase de datos contienen estos en la tabla?:
@LOGINU
@CONTRASENAU
Osea, son integer, string, float, etc.....
Saludos

maeyanes
14-12-2007, 17:01:37
Hola...

El error es por que en algún lugar tratas de usar un valor de tipo string de algún campo, pero en la base de datos ese campo no tiene valor (es NULL) y al tratar de hacer la conversión falla...

Checa ese aspecto...



Saludos...

mikylin
14-12-2007, 20:51:59
holas chicos:

@login
@contraseña
son los parametros que envio a mi procedimiento almacenado, para comprobar la cuenta del usuario, y son de tipo char


gracias por toda la ayuda.