* * *

Author Topic: insert without parambyname  (Read 309 times)

majid.ebru

  • Full Member
  • ***
  • Posts: 133
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 ?!?!

valdir.marcos

  • Full Member
  • ***
  • Posts: 214
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

  • Jr. Member
  • **
  • Posts: 92
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

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

 

Recent

Get Lazarus at SourceForge.net. Fast, secure and Free Open Source software downloads Open Hub project report for Lazarus