[Gambas-user] What is wrong with my query syntax?

Gianluigi bagonergi at gmail.com
Fri Dec 29 11:42:03 CET 2017


The question seems to be placed in the correct place [0]
Even SQL seems correct, maybe a question of apostrophe?
Dim sName As String
sName = TBXName.Text
sName = Replace(sName,"'","''")
$Query = “SELECT * FROM Friends WHERE Name = '” & sName & “'”

[0] https://lists.gambas-basic.org/pipermail/user/2017-December/thread.html

Regards
Gianluigi


2017-12-29 11:18 GMT+01:00 Johny Provoost <johny.provoost at skynet.be>:

> I always use
>
> $Query = “SELECT * FROM Friends WHERE Name = ” & "\"" & TBXName.Text & "\""
>
> and use formname.TBXNamer.Text but don't know if that's the problem
>
> By the way, This maillist is changed to 'gambas-user at lists.sourceforge.net'.
> You should use this one.
>
> Kind Regards,
>
> Johny
>
>
> Op 29-12-17 om 04:43 schreef Doug Hutcheson:
>
>> Hi. I'm a new user and I have misunderstood something.
>>
>> I am trying to establish a connection to a PostgreSQL database.
>>
>>  At http://gambaswiki.org/wiki/howto/database?ht=database-manager, point
>> 6, I read the following example of a query:
>>                 Dim $Query As String
>>                $Query = “SELECT * FROM Friends WHERE Name = '” &
>> TBXName.Text & “'”
>>
>> However, no matter how I try, I always get a syntax error on the
>> assignment line. Obviously I am missing something - can you help?
>>
>> Kind regards,
>> Doug
>>
>>
>> --------------------------------------------------
>>
>> This is the Gambas Mailing List
>> https://lists.gambas-basic.org/listinfo/user
>>
>> Hosted by https://www.hostsharing.net
>>
>
>
> --------------------------------------------------
>
> This is the Gambas Mailing List
> https://lists.gambas-basic.org/listinfo/user
>
> Hosted by https://www.hostsharing.net
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.gambas-basic.org/pipermail/user/attachments/20171229/37693fe9/attachment.html>


More information about the User mailing list