How can I find inbeded strings in SQL an field using the 'LIKE' operator using VB6
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?
Microsoft DevelopmentMicrosoft SQL Server 2008
8/22/2022 - Mon
Experts Exchange has (a) saved my job multiple times, (b) saved me hours, days, and even weeks of work, and often (c) makes me look like a superhero! This place is MAGIC!