Hi everyone. I have solved it. The problem was that cutting and pasting from the wiki brought across some unwanted non-printing character(s). When I typed the assignment line in by hand, there was no syntax error. Many thanks who replied on the other thread, as I have learned something in the process.
Kind regards, Doug On Sat, 2017-12-30 at 15:43 +1000, Doug Hutcheson wrote: > Hi everyone. This is carried over from the thread I should not have > started at <u...@lists.gambas-basic.org>, for which I apologise. > > Many thanks for the suggestions put forward. > > I think I need to clarify a little. 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 . What I mean by > a syntax error is that the Basic IDE underlines in red everything from > the first double quote and any attempt to run the code throws "Syntax > error in MODmain module at line 26". > > I also tried with this line: > $Query = “SELECT * FROM abpa.tblParameters" > which bypasses any string conversions as above. I have tried inserting > a semicolon at the end of the statement within the double quotes. I > have tried putting the table name within single quotes. I have run out > of ideas. > > So the question really is: is there an error in the code posted on the > Wiki, or is it my use of the code which is in error? Right now, > following the code example, I still cannot connect to my database. > > Kind regards, > Doug > ------------------------------------------------------------------------------ Check out the vibrant tech community on one of the world's most engaging tech sites, Slashdot.org! http://sdm.link/slashdot _______________________________________________ Gambas-user mailing list Gambas-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/gambas-user