I'm creating a VBScript sub to read from a SQL Server table. The select reads records filtering from a particular primary key value passed by a QV variable.
I have sSQL = "SELECT TOP 1 Code FROM myTable where code = '" & varCodeValue & "'".
When it exists a record for code value I can control the select result with sSQL.Fields(0).Value, but when no records are found I have an error.
How can I verify when my select returns no records? Thanks