Ver Mensaje Individual
  #7  
Antiguo 07-09-2010
Avatar de microbiano
microbiano microbiano is offline
Miembro
 
Registrado: sep 2008
Ubicación: Mexico D.F
Posts: 349
Reputación: 18
microbiano Va por buen camino
sigue mi duda con parametros

bueno resulta que ya investigue y al parecer no encuentro la respuesta a mi duda del porque no puedo usar parametros en las instrucciones sql lo que para unos hacer un insert es tan facil como
Código Delphi [-]
 SQL.Clear;
      sql.Add('Insert into sap_serv(nombreserv,cuota)');
      SQL.Add('Values( :servicio, :cuota)');
      Parameters.ParamByName('servicio').Value:=wservicio;
      Parameters.ParamByName('cuota').Value:=wcuota;

yo tengo que hacer lo siguiente
Código Delphi [-]
sql.Clear;
     sql.Add(' insert into sap_contrato (');
     Sql.Add(' nocontrato ,');    //1
     sql.Add(' nombre ,');//2
     sql.Add(' paterno ,');//3
     sql.Add(' materno ,');//4
     sql.Add(' ncompleto, '); //5
     sql.Add(' localidad ,');//6
     sql.Add(' calle ,');//7
     sql.Add(' noext ,');//8
     sql.Add(' noint ,');//9
     sql.Add(' cp ,');//10
     sql.Add(' fecharegistro ,');//111
     sql.Add(' telefono ,');//12
     sql.Add(' observacio, ');//13
     sql.add(' status ');//14
     sql.Add(' ) values (');
     sql.Add(' '+QuotedStr(wnocontrato)+', ');//1
     sql.Add(' '+QuotedStr(wnombre)+', ');//2
     sql.Add(' '+QuotedStr(wpaterno)+', ');//3
     sql.Add(' '+QuotedStr(wmaterno)+', ');//4
     sql.Add(' '+QuotedStr(wcompleto)+', '); //5
     sql.add(' '+QuotedStr(wlocalidad)+', ');//6
     sql.Add(' '+QuotedStr(wcalle)+', ');//7
     sql.Add(' '+IntToStr(wnoint)+', ');//8
     sql.Add(' '+inttostr(wnoext)+', ');//9
     sql.Add(' '+Inttostr(wcp)+', '); //10
     sql.Add(' '+QuotedStr(DateToStr(wfechare))+', ');//11
     sql.Add(' '+QuotedStr(wtel)+', ');//12
     sql.Add(' '+QuotedStr(wobs)+', ');//13
     sql.Add(' '+Inttostr(westatus) +')');//14
      ExecSQL;

AHORA LO QUE PREGUNTO ES HAY AKLGUNA EXTRAÑA RAZON DEL PORQUE ALGUNOS PUEDEN USAR PARAMETROS Y OTROS NO, O DEPENDE DE LA BASE DE DATOS O DE LOS COMPOMENTES QUE SE USAN PARA ACCEDER A ELLOS O DE LAS USES.

mis uses

Código Delphi [-]
uses
  Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
  Dialogs, StdCtrls, ExtCtrls, Buttons, ComCtrls,ADODB,ComObj,DateUtils;


IS COMPONENTE SON

ADOCONEXION,ADOQUERY,ADOSTOREPROCEDURE.


Y MI BASE DE DATOS ES

SQLSERVER 2000

CONTRAVENENO, QUE USES TIENES REGISTRADAS, QUE BASE DE DATOS USAS Y QUE COMPONENTES?

ESPERO ME RESPONDAN :-)
Responder Con Cita