I am trying to query an Azure database using MSSQLServerPreparedStatement, code below.
Dim sql As Text = "SELECT * FROM bc_form WHERE id = ?"
Dim ps As MSSQLServerPreparedStatement = mDB.Prepare(sql)
Dim rs As RecordSet
rs = ps.SQLSelect(id.ToText)
where id =5, I have tested using 5 in place of id.ToText, still gives me errors. I have also tried to bind using the following code.
Dim sql As Text = "SELECT * FROM bc_form WHERE id = ?"
Dim ps As MSSQLServerPreparedStatement = mDB.Prepare(sql)
ps.BindType(0, MSSQLServerPreparedStatement.MSSQLSERVER_TYPE_INT)
ps.Bind(0, id)
Dim rs As RecordSet
rs = ps.SQLSelect
However going back to just using mDB.SQLSelect works
Dim sql As Text = "SELECT * FROM bc_form WHERE id = " + id.ToText
Dim rs As RecordSet
rs = mDB.SQLSelect(sql)
Any thoughts, thanks.