Using Windows 10 and Xojo 2023r2 on Web
MSSQL connecting using ODBC 64 bit with SQL Server driver
When I use a select statement with parameters, I get an error “Fetch type out of range” on the SelectSQL line. If I remove the parameter then it works without error.
var sql as string
var rs as rowset
sql = "Select email FROM admins WHERE region = ?"
try
rs = Session.db.SelectSQL(sql, PmBranch.RowTagAt(pmbranch.SelectedRowIndex).StringValue)
catch e as DatabaseException
messagebox(e.message)
end try
if rs <> Nil then
if not rs.AfterLastRow then
FinalEmail = rs.column("Email").StringValue
end if
rs.close
end if