Login ProductsSalesSupportDownloadsAbout |
Home » Technical Support » DBISAM Technical Support » Support Forums » DBISAM SQL » View Thread |
Messages 1 to 10 of 10 total |
SQL Help Needed!!!!! |
Tue, Jan 16 2007 9:55 PM | Permanent Link |
Steven | Hi,
I use dbisam 4.24 and delphi. when I run the code procedure TForm2.Button2Click(Sender: TObject); var S: string; begin S := 'Update Projects set Name = 'peter'#$D#$A'stevn' ' DBISAMQuery1.sql.text : =s; DBISAMQuery1.Open; end; error!!!!! but i run it in SQL sever : okey! thanks Steven |
Tue, Jan 16 2007 10:26 PM | Permanent Link |
Jason Lee | Instead of using DBISAMQuery1.Open use DBISAMQuery1.ExecSQL
Open is used for queries that you are expecting a result set for (e.g. select queries). Steven wrote: > Hi, > > I use dbisam 4.24 and delphi. > > when I run the code > > procedure TForm2.Button2Click(Sender: TObject); > var > S: string; > begin > S := 'Update Projects set Name = 'peter'#$D#$A'stevn' ' > DBISAMQuery1.sql.text : =s; > DBISAMQuery1.Open; > end; > > error!!!!! > > > > but i run it in SQL sever : okey! > > > > > thanks > > Steven > |
Tue, Jan 16 2007 10:40 PM | Permanent Link |
Steven | THANKS!!!!
procedure TForm2.Button2Click(Sender: TObject); var S: string; begin S := 'Update Projects set Name = 'peter steven' ' DBISAMQuery1.sql.text : =s; DBISAMQuery1.execSQL; end; >>>>>>>>>>>>OK!!!! procedure TForm2.Button2Click(Sender: TObject); var S: string; begin S := 'Update Projects set Name = 'peter'#$D#$A'steven' ' DBISAMQuery1.sql.text : =s; DBISAMQuery1.execSQL; end; >>>>>>>>>>>>ERROR!!!! Jason Lee <computerguy@wavecable.com> wrote: Instead of using DBISAMQuery1.Open use DBISAMQuery1.ExecSQL Open is used for queries that you are expecting a result set for (e.g. select queries). Steven wrote: > Hi, > > I use dbisam 4.24 and delphi. > > when I run the code > > procedure TForm2.Button2Click(Sender: TObject); > var > S: string; > begin > S := 'Update Projects set Name = 'peter'#$D#$A'stevn' ' > DBISAMQuery1.sql.text : =s; > DBISAMQuery1.Open; > end; > > error!!!!! > > > > but i run it in SQL sever : okey! > > > > > thanks > > Steven > |
Tue, Jan 16 2007 10:46 PM | Permanent Link |
"Adam H." | Hi Steven,
Try using double quotes (ie 2x'), before peter, and after stevn s := 'Update Projects set Name = ''peter'#D#$A'stevn'' '; Note - the two quotes above are 2 lots of single quotes, and not one double-quote. Alternatively, I believe theirs a quotedstr function you could use instead, such as: 'Update Projects set Name = '+quotedstr('peter'+#$D#$A+'stev'); I'm not sure what the #D#$A stands for that your putting in there though. Best Regards Adam. "Steven" <steven20070707@yahoo.com > wrote in message news:68A918D3-F0AF-47CB-AF48-10EB16E89401@news.elevatesoft.com... > Hi, > > I use dbisam 4.24 and delphi. > > when I run the code > > procedure TForm2.Button2Click(Sender: TObject); > var > S: string; > begin > S := 'Update Projects set Name = 'peter'#$D#$A'stevn' ' > DBISAMQuery1.sql.text : =s; > DBISAMQuery1.Open; > end; > > error!!!!! > > > > but i run it in SQL sever : okey! > > > > > thanks > > Steven > |
Wed, Jan 17 2007 1:06 AM | Permanent Link |
Steven | thnaks!!!
try using a quotedstr function...: s := 'Update Projects set Name = '+quotedstr('peter'+#$D#$A+'stev'); >>>>>>Microsoft SQL server: Okay >>>>>>dbisam 2.24: error "Adam H." <ahairsub4@rREMOVEMEspamSTOPPER.jvxp.com> wrote: Hi Steven, Try using double quotes (ie 2x'), before peter, and after stevn s := 'Update Projects set Name = ''peter'#D#$A'stevn'' '; Note - the two quotes above are 2 lots of single quotes, and not one double-quote. Alternatively, I believe theirs a quotedstr function you could use instead, such as: 'Update Projects set Name = '+quotedstr('peter'+#$D#$A+'stev'); I'm not sure what the #D#$A stands for that your putting in there though. Best Regards Adam. "Steven" <steven20070707@yahoo.com > wrote in message news:68A918D3-F0AF-47CB-AF48-10EB16E89401@news.elevatesoft.com... > Hi, > > I use dbisam 4.24 and delphi. > > when I run the code > > procedure TForm2.Button2Click(Sender: TObject); > var > S: string; > begin > S := 'Update Projects set Name = 'peter'#$D#$A'stevn' ' > DBISAMQuery1.sql.text : =s; > DBISAMQuery1.Open; > end; > > error!!!!! > > > > but i run it in SQL sever : okey! > > > > > thanks > > Steven > |
Wed, Jan 17 2007 5:11 AM | Permanent Link |
Roy Lambert NLH Associates Team Elevate | Steven
Try s := 'Update Projects set Name = '+quotedstr('peter'+#13+#10+'stev'); Roy Lambert |
Wed, Jan 17 2007 8:06 PM | Permanent Link |
Steven | thnaks!!!
try using a quotedstr function...: s := 'Update Projects set Name = '+quotedstr('peter'+#$D#$A+'stev'); >>>>>>Microsoft SQL server: Okay >>>>>>dbisam 2.24: error Roy Lambert <roy.lambert@skynet.co.uk> wrote: Steven Try s := 'Update Projects set Name = '+quotedstr('peter'+#13+#10+'stev'); Roy Lambert |
Thu, Jan 18 2007 4:30 PM | Permanent Link |
"Johnnie Norsworthy" | Steven,
It must be an issue with the embedded control characters. Try using parameters. At design time: SQL: UPDATE Projects SET Name=:NameParm Params: NameParam set datatype to ftString At run time: Query.ParamByName('NameParm').AsString := 'Peter'+Chr(13)+Chr(10)+'stev'; { you can use anything here #13#10 or whatever } Query.ExecSQL; Using parameterized queries is the best way to handle complex strings and dates that would have to be encoded special for SQL text. -Johnnie "Steven" <steven20070707@yahoo.com> wrote in message news:D81B2FD8-6966-4DC4-96F7-301504F9EAC5@news.elevatesoft.com... > thnaks!!! > > try using a quotedstr function...: > > s := 'Update Projects set Name = '+quotedstr('peter'+#$D#$A+'stev'); > > >>>>>>>Microsoft SQL server: Okay >>>>>>>dbisam 2.24: error > Roy Lambert <roy.lambert@skynet.co.uk> wrote: > > Steven > > Try > > > s := 'Update Projects set Name = '+quotedstr('peter'+#13+#10+'stev'); > > Roy Lambert > |
Thu, Jan 18 2007 5:03 PM | Permanent Link |
Tim Young [Elevate Software] Elevate Software, Inc. timyoung@elevatesoft.com | Johnnie,
<< It must be an issue with the embedded control characters. Try using parameters. >> It is an issue with the CRLF characters. DBISAM cannot handle embedded CRLF characters in literal SQL text without using something like this: S := 'Update Projects set Name = ''peter''+#13+#10+''stevn''' DBISAMQuery1.sql.text : =s; DBISAMQuery1.Open; end; -- Tim Young Elevate Software www.elevatesoft.com |
Thu, Jan 18 2007 9:35 PM | Permanent Link |
Steven | thanks all!!!!
steven |
This web page was last updated on Sunday, May 5, 2024 at 10:18 AM | Privacy PolicySite Map © 2024 Elevate Software, Inc. All Rights Reserved Questions or comments ? E-mail us at info@elevatesoft.com |