Icon View Thread

The following is the text of the current message along with any replies.
Messages 1 to 10 of 20 total
Thread query problem
Fri, Jun 7 2013 3:15 AMPermanent Link

Paul Waegemans

IMS bvba

Avatar

As I use the following query:

ZoekContacten1.Params.Clear;
ZoekContacten1.Params.Add('Volnaam='''+V_loginnaam+'''');
Database.Load(ZoekContacten1);

and V_loginnaam=D'HAEMERS

then I have the error code hereby enclosed

Paul.



Attachments: Uncaught Error.jpg
Mon, Jun 10 2013 2:38 PMPermanent Link

Tim Young [Elevate Software]

Elevate Software, Inc.

Avatar

Email timyoung@elevatesoft.com

Paul,

<< then I have the error code hereby enclosed >>

You should be able to deal with this by doubling-up the embedded single
quote in the parameter.  I'm adding a new TStringBuilder class to the next
build that will help with this.

If you have any other questions, please let me know.

Tim Young
Elevate Software
www.elevatesoft.com


Fri, Jun 21 2013 11:28 AMPermanent Link

Paul Waegemans

IMS bvba

Avatar

The query also has problems retrieving the names

ÍNER VOLKAN
DENEVE BJÍRN

due to   Í  I suppose??






"Tim Young [Elevate Software]" wrote:

Paul,

<< then I have the error code hereby enclosed >>

You should be able to deal with this by doubling-up the embedded single
quote in the parameter.  I'm adding a new TStringBuilder class to the next
build that will help with this.

If you have any other questions, please let me know.

Tim Young
Elevate Software
www.elevatesoft.com


Fri, Jun 21 2013 4:10 PMPermanent Link

Tim Young [Elevate Software]

Elevate Software, Inc.

Avatar

Email timyoung@elevatesoft.com

Paul,

<< The query also has problems retrieving the names

ÍNER VOLKAN
DENEVE BJÍRN

due to   Í  I suppose?? >>

No, that shouldn't be an issue.  What problem specifically are you seeing ?
Please try to be as specific as possible when asking for help, and avoid
using generic descriptions of issues such as "having a problem" or "doesn't
work", and please post complete error messages.

Thanks,

Tim Young
Elevate Software
www.elevatesoft.com

Tue, Jul 2 2013 3:52 PMPermanent Link

Paul Waegemans

IMS bvba

Avatar

I do not understand what you mean by this and how to do it?   What is the syntax then?

"You should be able to deal with this by doubling-up the embedded single quote in the parameter."




"Tim Young [Elevate Software]" wrote:

Paul,

<< then I have the error code hereby enclosed >>

You should be able to deal with this by doubling-up the embedded single
quote in the parameter.  I'm adding a new TStringBuilder class to the next
build that will help with this.

If you have any other questions, please let me know.

Tim Young
Elevate Software
www.elevatesoft.com


Wed, Jul 3 2013 2:54 AMPermanent Link

alexza

Your param contains a quote. This causes the error, bacause the resulting sequence of quotes is now unbalanced.

You must make sure that an eventual quote in the param gets doubled, like in H''EXAMPLE, so to be escaped.

Best regards

alex

Paul Waegemans wrote:

I do not understand what you mean by this and how to do it?   What is the syntax then?

"You should be able to deal with this by doubling-up the embedded single quote in the parameter."
Wed, Jul 3 2013 4:05 PMPermanent Link

Paul Waegemans

IMS bvba

Avatar

the name is typed by the user through an editfield.  How do I manage to double a single quote?

alexza wrote:

Your param contains a quote. This causes the error, bacause the resulting sequence of quotes is now unbalanced.
j
You must make sure that an eventual quote in the param gets doubled, like in H''EXAMPLE, so to be escaped.

Best regards

alex

Paul Waegemans wrote:

I do not understand what you mean by this and how to do it?   What is the syntax then?

"You should be able to deal with this by doubling-up the embedded single quote in the parameter."
Thu, Jul 4 2013 4:25 AMPermanent Link

alexza

use a function like "strtran() -- search string for substring then replace it" onto the editfield content;

there are many Delphy open source implementations on the web.



Paul Waegemans wrote:

the name is typed by the user through an editfield.  How do I manage to double a single quote?

alexza wrote:

Your param contains a quote. This causes the error, bacause the resulting sequence of quotes is now unbalanced.
j
You must make sure that an eventual quote in the param gets doubled, like in H''EXAMPLE, so to be escaped.

Best regards

alex

Paul Waegemans wrote:

I do not understand what you mean by this and how to do it?   What is the syntax then?

"You should be able to deal with this by doubling-up the embedded single quote in the parameter."
Thu, Jul 4 2013 5:20 AMPermanent Link

Matthew Jones

> the name is typed by the user through an editfield.  How do I
> manage to double a single quote?

Create a function with a for loop to look through the string, and if it finds a
single quote, put two quotes into the result, otherwise output the character it
found. Basic programming is still required.

/Matthew Jones/
Sun, Jul 7 2013 4:45 AMPermanent Link

Paul Waegemans

IMS bvba

Avatar

Doubling the quote is not the problem but if I make a double quote from a quote than the query will look for D''HAEMERS in the table and not for D'HAEMERS so this will not give the good result?

The same problem with the function StrReplace:

before:=v_loginnaam;
v_loginnaam:=StrReplace(before, 'd', ' ', True, True);  

If I replace d with ' this does not work...



(Matthew Jones) wrote:

> the name is typed by the user through an editfield.  How do I
> manage to double a single quote?

Create a function with a for loop to look through the string, and if it finds a
single quote, put two quotes into the result, otherwise output the character it
found. Basic programming is still required.

/Matthew Jones/
Page 1 of 2Next Page
Jump to Page:  1 2
Image