VB syntax - quotes in string


Author
Message
Charles R Hankey
Charles R Hankey
Advanced StrataFrame User (922 reputation)Advanced StrataFrame User (922 reputation)Advanced StrataFrame User (922 reputation)Advanced StrataFrame User (922 reputation)Advanced StrataFrame User (922 reputation)Advanced StrataFrame User (922 reputation)Advanced StrataFrame User (922 reputation)Advanced StrataFrame User (922 reputation)Advanced StrataFrame User (922 reputation)
Group: Forum Members
Posts: 524, Visits: 30K
Interesting. Makes perfect sense of course but I just never saw anything in VB docs that said single quotes was an option for anything as a string delimiter ( as I said in Foxpro we could use single or double quotes or square brackets to fiddle with any kinds of strings ) and when I googled for a solution nobody mentioned single quotes.



This makes things a lot easier.
Charles R Hankey
Charles R Hankey
Advanced StrataFrame User (922 reputation)Advanced StrataFrame User (922 reputation)Advanced StrataFrame User (922 reputation)Advanced StrataFrame User (922 reputation)Advanced StrataFrame User (922 reputation)Advanced StrataFrame User (922 reputation)Advanced StrataFrame User (922 reputation)Advanced StrataFrame User (922 reputation)Advanced StrataFrame User (922 reputation)
Group: Forum Members
Posts: 524, Visits: 30K
Just regoogled and found you're correct dataview.rowfilter uses single quotes as a reserved character ( also means if the single quote - or apostrophe - is part of the string you need to double it to get the desired result



dataview1.rowfilter = "searchfield = 'Mike''s Apartment'"



Charles R Hankey
Charles R Hankey
Advanced StrataFrame User (922 reputation)Advanced StrataFrame User (922 reputation)Advanced StrataFrame User (922 reputation)Advanced StrataFrame User (922 reputation)Advanced StrataFrame User (922 reputation)Advanced StrataFrame User (922 reputation)Advanced StrataFrame User (922 reputation)Advanced StrataFrame User (922 reputation)Advanced StrataFrame User (922 reputation)
Group: Forum Members
Posts: 524, Visits: 30K
Apropos of this discussion I just ran across this snippet re dates in filter strings so thought I'd stick it here for the benefit of anyone (like me) who may be searching later and need it.



filterON = String.Format("EnterDateTime >= #{0}# and EnterDateTime <= #{1}#", begDate.Date,endDate.Date)

Greg McGuffey
Greg McGuffey
Strategic Support Team Member (3.4K reputation)
Group: Forum Members
Posts: 2K, Visits: 6.6K
Thanks for the additional info Charles! BigGrin



These sorts of things can be hard to figure out when moving to .NET. Nice to have em in one place. BigGrin
GO

Merge Selected

Merge into selected topic...



Merge into merge target...



Merge into a specific topic ID...




Similar Topics

Reading This Topic

Login

Explore
Messages
Mentions
Search