Club Delphi  
    FTP   CCD     Buscar   Trucos   Trabajo   Foros

Retroceder   Foros Club Delphi > Bases de datos > DB2
Registrarse FAQ Miembros Calendario Guía de estilo Temas de Hoy

Respuesta
 
Herramientas Buscar en Tema Desplegado
  #1  
Antiguo 13-12-2007
mikylin mikylin is offline
Miembro
 
Registrado: dic 2007
Ubicación: Chuquisaca_Bolivia
Posts: 11
Poder: 0
mikylin Va por buen camino
problemas con la ejecucion de mi aplicacion en delphi

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
Responder Con Cita
  #2  
Antiguo 13-12-2007
Avatar de Caral
[Caral] Caral is offline
Miembro Premium
 
Registrado: ago 2006
Posts: 7.659
Poder: 25
Caral Va por buen camino
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
Responder Con Cita
  #3  
Antiguo 13-12-2007
mikylin mikylin is offline
Miembro
 
Registrado: dic 2007
Ubicación: Chuquisaca_Bolivia
Posts: 11
Poder: 0
mikylin Va por buen camino
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.
Responder Con Cita
  #4  
Antiguo 13-12-2007
Avatar de Caral
[Caral] Caral is offline
Miembro Premium
 
Registrado: ago 2006
Posts: 7.659
Poder: 25
Caral Va por buen camino
Hola
La palabra variant no te va a salir en ningun lado.
Coloca el codigo que te da problemas aqui y lo vemos.
Saludos
Responder Con Cita
  #5  
Antiguo 13-12-2007
mikylin mikylin is offline
Miembro
 
Registrado: dic 2007
Ubicación: Chuquisaca_Bolivia
Posts: 11
Poder: 0
mikylin Va por buen camino
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.
Responder Con Cita
  #6  
Antiguo 13-12-2007
Avatar de Caral
[Caral] Caral is offline
Miembro Premium
 
Registrado: ago 2006
Posts: 7.659
Poder: 25
Caral Va por buen camino
Hola
Usa las etiquetas delphi, se vera mejos asi:
Código Delphi [-]
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
Responder Con Cita
  #7  
Antiguo 13-12-2007
Avatar de Caral
[Caral] Caral is offline
Miembro Premium
 
Registrado: ago 2006
Posts: 7.659
Poder: 25
Caral Va por buen camino
Hola
Aqui no hay nada, solo que usas un MODULOENLACE.
No me dice nada.
Saludos
Responder Con Cita
  #8  
Antiguo 14-12-2007
mikylin mikylin is offline
Miembro
 
Registrado: dic 2007
Ubicación: Chuquisaca_Bolivia
Posts: 11
Poder: 0
mikylin Va por buen camino
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)
Código Delphi [-]
    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.
Responder Con Cita
  #9  
Antiguo 14-12-2007
Avatar de Caral
[Caral] Caral is offline
Miembro Premium
 
Registrado: ago 2006
Posts: 7.659
Poder: 25
Caral Va por buen camino
Hola
Que clase de datos contienen estos en la tabla?:
@LOGINU
@CONTRASENAU
Osea, son integer, string, float, etc.....
Saludos
Responder Con Cita
  #10  
Antiguo 14-12-2007
[maeyanes] maeyanes is offline
Capo de los Capos
 
Registrado: may 2003
Ubicación: Campeche, México
Posts: 2.732
Poder: 23
maeyanes Va por buen camino
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...
Responder Con Cita
  #11  
Antiguo 14-12-2007
mikylin mikylin is offline
Miembro
 
Registrado: dic 2007
Ubicación: Chuquisaca_Bolivia
Posts: 11
Poder: 0
mikylin Va por buen camino
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.
Responder Con Cita
Respuesta



Normas de Publicación
no Puedes crear nuevos temas
no Puedes responder a temas
no Puedes adjuntar archivos
no Puedes editar tus mensajes

El código vB está habilitado
Las caritas están habilitado
Código [IMG] está habilitado
Código HTML está deshabilitado
Saltar a Foro

Temas Similares
Tema Autor Foro Respuestas Último mensaje
problemas con el Delphi al compilar aplicacion !!! Goyo Varios 2 11-07-2007 17:25:05
Migración a 10g release 2 - Problemas con la aplicación de Delphi .NET SMTZ .NET 2 11-07-2006 09:58:20
Creación de directorios en tiempo de ejecución desde aplicación Delphi vick Conexión con bases de datos 1 16-12-2005 21:18:17
Creación de directorios en tiempo de ejecución desde aplicación Delphi vick API de Windows 1 16-12-2005 21:13:35
Automatizar la ejecucion de una aplicacion MarcoMae Varios 3 15-07-2005 16:00:03


La franja horaria es GMT +2. Ahora son las 17:06:26.


Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Traducción al castellano por el equipo de moderadores del Club Delphi
Copyright 1996-2007 Club Delphi