ayuda con unit db
Publicado por erick (23 intervenciones) el 06/04/2006 20:26:35
Hola!!
Tengo un problema al declarar el unit db para utilizar ftstring ,ftinteger... etc,
lo declaro de la siguiente manera :
unit db;
me manda el seguiente error:
[Error] Unit1.pas(2): 'INTERFACE' expected but 'UNIT' found
lo ke kiero es insertar datos el bd pero me ha estado causando mucho conflicto y mi codigo esta de la siguiente manera:
ejemplo.insertar.close;
ejemplo.insertar.sql.clear;
ejemplo.insertar.SQL.add('insert into clientes (id_cliente,nombre,apellido_paterno,apellido_materno,domicilio,codigo_postal,telefono,
fecha_ingreso)values(:id, :nom, :ap, :am, :dom, :cp, :tel, :fecha)');
ejemplo.insertar.Parameters[0].DataType:=ftinteger;
ejemplo.insertar.Parameters[0].asInteger:= strtoint(id.text);
ejemplo.insertar.Parameters[1].DataType:=ftstring;
ejemplo.insertar.Parameters[1].asString:=nom.text;
ejemplo.insertar.Parameters[2].DataType:=ftstring;
ejemplo.insertar.Parameters[2].asString:=ap.text;
ejemplo.insertar.Parameters[3].DataType:=ftstring;
ejemplo.insertar.Parameters[3].asString:= am.text;
ejemplo.insertar.Parameters[4].DataType:=ftstring;
ejemplo.insertar.Parameters[4].asString:= dom;
ejemplo.insertar.Parameters[5].DataType:=ftinteger;
ejemplo.insertar.Parameters[5].asInteger:= strtoint(cp.text);
ejemplo.insertar.Parameters[6].DataType:=ftinteger;
ejemplo.insertar.Parameters[6].asInteger:= strtoint(tel.text);
ejemplo.insertar.Parameters[7].DataType:=ftdatetime;
ejemplo.insertar.Parameters[7].asDateTime:=strtodatetime(fecha.text);
ejemplo.insertar.ExecSQL;
y me aparecen una serie de errores:
[Error] Unit1.pas(57): Undeclared identifier: 'ftinteger'
[Error] Unit1.pas(58): Undeclared identifier: 'asInteger'
[Error] Unit1.pas(59): Undeclared identifier: 'ftstring'
[Error] Unit1.pas(60): Undeclared identifier: 'asString'
y asi con todos si me podrian mandar un ejemplo de como insercion,modificacion y elminacion porfavor!!
Tengo un problema al declarar el unit db para utilizar ftstring ,ftinteger... etc,
lo declaro de la siguiente manera :
unit db;
me manda el seguiente error:
[Error] Unit1.pas(2): 'INTERFACE' expected but 'UNIT' found
lo ke kiero es insertar datos el bd pero me ha estado causando mucho conflicto y mi codigo esta de la siguiente manera:
ejemplo.insertar.close;
ejemplo.insertar.sql.clear;
ejemplo.insertar.SQL.add('insert into clientes (id_cliente,nombre,apellido_paterno,apellido_materno,domicilio,codigo_postal,telefono,
fecha_ingreso)values(:id, :nom, :ap, :am, :dom, :cp, :tel, :fecha)');
ejemplo.insertar.Parameters[0].DataType:=ftinteger;
ejemplo.insertar.Parameters[0].asInteger:= strtoint(id.text);
ejemplo.insertar.Parameters[1].DataType:=ftstring;
ejemplo.insertar.Parameters[1].asString:=nom.text;
ejemplo.insertar.Parameters[2].DataType:=ftstring;
ejemplo.insertar.Parameters[2].asString:=ap.text;
ejemplo.insertar.Parameters[3].DataType:=ftstring;
ejemplo.insertar.Parameters[3].asString:= am.text;
ejemplo.insertar.Parameters[4].DataType:=ftstring;
ejemplo.insertar.Parameters[4].asString:= dom;
ejemplo.insertar.Parameters[5].DataType:=ftinteger;
ejemplo.insertar.Parameters[5].asInteger:= strtoint(cp.text);
ejemplo.insertar.Parameters[6].DataType:=ftinteger;
ejemplo.insertar.Parameters[6].asInteger:= strtoint(tel.text);
ejemplo.insertar.Parameters[7].DataType:=ftdatetime;
ejemplo.insertar.Parameters[7].asDateTime:=strtodatetime(fecha.text);
ejemplo.insertar.ExecSQL;
y me aparecen una serie de errores:
[Error] Unit1.pas(57): Undeclared identifier: 'ftinteger'
[Error] Unit1.pas(58): Undeclared identifier: 'asInteger'
[Error] Unit1.pas(59): Undeclared identifier: 'ftstring'
[Error] Unit1.pas(60): Undeclared identifier: 'asString'
y asi con todos si me podrian mandar un ejemplo de como insercion,modificacion y elminacion porfavor!!
Valora esta pregunta


0