SELECT * FROM Customer WHERE FirstName LIKE ?vp_FirstNameI am using SQL Server and FirstName is char(30) field. As per documentation, when I issue CursorFill(), VFP generates ADODB.Command object behind the scene and builds the cursor. I have noticed something strange here. When I set vp_FirstName to '%', it doesn't return all rows. I got the SQL from SQL Profiler which looks like this:
exec sp_executesql N'select * FROM Customer WHERE Customer.FirstName LIKE @P1 ', N'@P1 char(30)', '% 'Notice that it appeneds 29 trailing spaces to the parameter value and that's why it is not working the way I would expect. If I change the Data Type to VARCHAR(30), it works.