Re: [Gambas-user] DB.Quote() doesn't quotes apostrophes

2012-01-23 Thread Benoît Minisini
Le 23/01/2012 19:07, M. Cs. a écrit : > I found a way to do, but I didn't understand what Benoit wanted: > If I have a query, I can always do the following: > Replace > "SELECT * FROM CATALOGS WHERE VName=." > with > "SELECT * FROM CATALOGS WHERE "& DB.Subst("VName=&1",...)& "..." > > That

Re: [Gambas-user] DB.Quote() doesn't quotes apostrophes

2012-01-23 Thread M. Cs.
I found a way to do, but I didn't understand what Benoit wanted: If I have a query, I can always do the following: Replace "SELECT * FROM CATALOGS WHERE VName=." with "SELECT * FROM CATALOGS WHERE " & DB.Subst("VName=&1",...) & "..." That can solve the problem. I'm sorry but something can be

Re: [Gambas-user] DB.Quote() doesn't quotes apostrophes

2012-01-23 Thread Caveat
Why not just process one term at a time? Dim conn As Connection Dim termStr As String Dim terms As String[] Dim enteredTerm, escapedTerm As String ... conn = DataAccess.getConnection() ... ' Get termStr from the input box 'termStr = txtQueryInput.Text ' Set termStr manua

Re: [Gambas-user] DB.Quote() doesn't quotes apostrophes

2012-01-23 Thread M. Cs.
Hello again: PRINT DB.Subst("WHERE Name = &1 AND Date = &2", "Benoit", Now) WHERE Name = 'Benoit' AND Date = '2006-02-15 11:51:33.043' This is the given example for the DB.Subst. But what if the user has a textBox input in which he can enter the search phrases divided by gaps like: "Benoit .jpg Su

Re: [Gambas-user] DB.Quote() doesn't quotes apostrophes

2012-01-23 Thread M. Cs.
I'm sorry Benoit, but I didn't realized that in "You must use DB.Subst()" the You is me. I was thinking you are answering to Johnny. I'll give a try. Csaba 2012/1/23, Benoît Minisini : > Le 23/01/2012 14:03, M. Cs. a écrit : >> Well, that was the thing I was fearing: I must handle the characters

Re: [Gambas-user] DB.Quote() doesn't quotes apostrophes

2012-01-23 Thread Benoît Minisini
Le 23/01/2012 14:03, M. Cs. a écrit : > Well, that was the thing I was fearing: I must handle the characters > by my own. The strange thing is , that if I have something like > DB.Exec("SELECT * FROM CATALOGS WHERE VName=&1","Blackmore's Night'") > the query won't fail. > I can even have query > DB

Re: [Gambas-user] DB.Quote() doesn't quotes apostrophes

2012-01-23 Thread M. Cs.
Well, that was the thing I was fearing: I must handle the characters by my own. The strange thing is , that if I have something like DB.Exec("SELECT * FROM CATALOGS WHERE VName=&1","Blackmore's Night'") the query won't fail. I can even have query DB.Exec("SELECT * FROM CATALOGS WHERE VName LiKE &1"

Re: [Gambas-user] DB.Quote() doesn't quotes apostrophes

2012-01-23 Thread Benoît Minisini
Le 23/01/2012 00:15, M. Cs. a écrit : > I have a dinamically created query text. I don't know the number of > parameters passed to the DB.Exec, so I cannot use&1,&2,... form. I > need to use the DB.Quote() > My problem is: If I have a string > mystring="Blackmore's Night", > the DB.Quote(mystring)

Re: [Gambas-user] DB.Quote() doesn't quotes apostrophes

2012-01-23 Thread Johny Provoost
op 23-01-12 00:15, M. Cs. schreef: > I have a dinamically created query text. I don't know the number of > parameters passed to the DB.Exec, so I cannot use&1,&2,... form. I > need to use the DB.Quote() > My problem is: If I have a string > mystring="Blackmore's Night", > the DB.Quote(mystring) wo

Re: [Gambas-user] DB.Quote() doesn't quotes apostrophes

2012-01-22 Thread John Spikowski
On Mon, 2012-01-23 at 00:15 +0100, M. Cs. wrote: > I have a dinamically created query text. I don't know the number of > parameters passed to the DB.Exec, so I cannot use &1,&2,... form. I > need to use the DB.Quote() > My problem is: If I have a string > mystring="Blackmore's Night", > the DB.Quot

Re: [Gambas-user] DB.Quote() doesn't quotes apostrophes

2012-01-22 Thread richard terry
On Monday 23 January 2012 10:15:07 M. Cs. wrote: > I have a dinamically created query text. I don't know the number of > parameters passed to the DB.Exec, so I cannot use &1,&2,... form. I > need to use the DB.Quote() > My problem is: If I have a string > mystring="Blackmore's Night", > the DB.Quot

[Gambas-user] DB.Quote() doesn't quotes apostrophes

2012-01-22 Thread M. Cs.
I have a dinamically created query text. I don't know the number of parameters passed to the DB.Exec, so I cannot use &1,&2,... form. I need to use the DB.Quote() My problem is: If I have a string mystring="Blackmore's Night", the DB.Quote(mystring) won't quote the ', so the query will crash. In fa