Recent

Author Topic: [SOLVED]insert without parambyname  (Read 2870 times)

majid.ebru

  • Sr. Member
  • ****
  • Posts: 494
[SOLVED]insert without parambyname
« on: May 15, 2017, 04:26:41 pm »
Hi
.
i use this code :
Code: Pascal  [Select][+][-]
  1.  ZQuery1.ParamByName('NamePerson').AsString:= EditPerson_Name.Text;
and insert data to DataBank and this code work corectly.
.
how can i insert data to bank without "ParamByName" , like use index number?
.
i use these codes,but don't work :'( :'(
Code: Pascal  [Select][+][-]
  1.  ZQuery1.Params.Items[0].AsString:= EditPerson_Name.Text;
  2.  
  3. and
  4.  
  5.  ZQuery1.Params[0].AsString:= EditPerson_Name.Text;"ParamByName"
  6.  
.
i don't want to use "ParamByName",is Replace code ?!?!
« Last Edit: July 01, 2017, 12:41:19 pm by majid.ebru »

valdir.marcos

  • Hero Member
  • *****
  • Posts: 1106
Re: insert without parambyname
« Reply #1 on: May 15, 2017, 07:11:00 pm »
Hi
.
i use this code :
Code: Pascal  [Select][+][-]
  1.  ZQuery1.ParamByName('NamePerson').AsString:= EditPerson_Name.Text;
and insert data to DataBank and this code work corectly.
.
how can i insert data to bank without "ParamByName" , like use index number?
.
i use these codes,but don't work :'( :'(
Code: Pascal  [Select][+][-]
  1.  ZQuery1.Params.Items[0].AsString:= EditPerson_Name.Text;
  2.  
  3. and
  4.  
  5.  ZQuery1.Params[0].AsString:= EditPerson_Name.Text;"ParamByName"
  6.  
.
i don't want to use "ParamByName",is Replace code ?!?!

Try:
Code: Pascal  [Select][+][-]
  1.   SQLQuery1.Params[0].AsString := 'Paul';

Maybe, your error is in the lost word "ParamByName" in the end of your line:
ZQuery1.Params[0].AsString:= EditPerson_Name.Text;"ParamByName"

What error message are you receiving?

miab3

  • Full Member
  • ***
  • Posts: 145
Re: insert without parambyname
« Reply #2 on: May 15, 2017, 07:38:11 pm »
Code: Pascal  [Select][+][-]
  1. ZQuery1.Params[0].AsString:= EditPerson_Name.Text; // or  ZQuery1.Params[0].Value:= EditPerson_Name.Text;
  2. ZQuery1.ExecSQL;
should work.

Michal

majid.ebru

  • Sr. Member
  • ****
  • Posts: 494
Re: insert without parambyname
« Reply #3 on: May 15, 2017, 08:20:58 pm »
so sorry i mistek %) %) %) %) %)

 

TinyPortal © 2005-2018