I'm trying to find records a substring within an SQL NVARCHAR field using VB6. My select statement is:
sCont = "SELECT * FROM " & sTDSubProfile _
& " WHERE Recording Like '%" & sOrg & "%'"
I'm trying to find all the records with sOrg in the 'Recording' field. The field contains text before and after the sOrg value. If I use the above select statement (replacing sOrg with the actual string) in the SQL Server Management Studio, I find numerous records. However in VB6 no records are found. I don't get any errors when using the above statement in the open command - just no records are found. I suspect that '%' may not be the proper wildcard character to use. Any ideas?