SQLite Search

Hello all,
I am trying to get a value from a column called :clienteID" in a table called “cliente”.
First, I copy the value of a form’s text field to a tmp var (tmpClienteName)
Then I tried to do a Select statement but when it runs, I get an excursion error ". For example, the tmpClienteName is “Annie Vargas” and the error is: Near "Annie: syntax error
What I want to do is get the ClienteID from the cliente table based on the name (which is also a column in the table.

Var tmpClienteName as String
var sql as string
tmpClienteName = str(QuoteConvertToFacturaView.lblcliente.value)
sql = ("SELECT * FROM Cliente WHERE cliente =? ") + tmpClienteName
rs1 = app.db.SelectSQL(sql)

If there is an easier way to search for a record in SQLite I will appreciate your input since I am getting used to this.


This is a syntax error. What you really want is this:

sql = "SELECT * FROM Cliente WHERE cliente =?"
rs1 = app.db.SelectSQL(sql, tmpClienteName)

Thank you Kem, I knew I was missing a small detail. I just couldn’t get it.