In a Visual Basic 6.0 program, I have a string sTemp that I want to ensure does not contain a quotation mark. I have the line:
If sTemp.Contains("""") Then
But when I type the period after sTemp, I don't get anything from intellisense, and when I try to compile I get the following error:
Compile error: Invalid qualifier
Best Answer
VB6 strings are not objects, so there are no methods on the string variable that you can call.
To test does the string contain quotes you need to use the
InStr
function i.e.Hope this helps
UPDATE This has nothing to do with the original question
William, I just thought of this, it is unrelated information that you may find useful.
There are many ways to shoot yourself in the foot with VB6.
Among the less obvious is the fact that
will have side effects you could never imagine.
Never DIM something AS New CSomething
Dim your variable, then on a second line, assign it to a new object. Hope this helps.