How use the insert query using parameters?

前端 未结 5 2020
猫巷女王i
猫巷女王i 2020-12-19 15:42

When i try with this query i get an error says that Perameter email doesn\'t exist, i am sure that the variables : email, login_pass, payment_method,operateur are valid and

5条回答
  •  慢半拍i
    慢半拍i (楼主)
    2020-12-19 16:43

    You should not use quotes around the parameter name.

    Parameters are automatically generated for you if your TSQLQuery has a connection assigned and ParamCheck is true and you assign TSQLQuery.CommandText.

    It will not generate the parameters when you assign the query to TSQLQuery.SQL.Text.

    You can have the parameters generated for you by calling TSQLQuery.Params.ParseSQL:

    SQLQuery2.Params.ParseSQL(SQLQuery2.SQL.Text, True);
    

    Or you can add them yourself by calling TSQLQuery.Params.AddParameter.

提交回复
热议问题