Skip to content
Advertisement

Delphi 7 Syntax error (comma) in ADO query

I’m trying to create a record in a database using a SQL query in Delphi 7. I’m using an ADO Query and I’ve tried both with and without parameters, but to no avail. The error occurs between ShowMessage 1 and 2.

The commented out part was the one way I tried doing this, and it gave this error:

Syntax error (comma) in query expression ‘Name=”Derp”,Surname=”Foo”,Birthday=”1900-01-01″‘

The code with parameters gives me this error:

Syntax error (comma) in query expression ‘Name=”Derp”,Surname=”Foo”,Birthday=”1900-01-01″‘

Any help would be greatly appreciated!

Advertisement

Answer

Now that we can see your real code, your error is clear

should use the AND operator to link those conditions :

You should also, naturally, seriously consider parameterizing this query as well.

User contributions licensed under: CC BY-SA
8 People found this is helpful
Advertisement