[thelist] VB6/ADO GetString compile error

Ken Schaefer ken at adOpenStatic.com
Mon Feb 9 18:45:14 CST 2004


Hi,

Just because there is only one constant that you can use for the first
parameter now doesn't mean that this has always been the case, or that there
wasn't an intention to have other values. I will have to check, but based on
a value of "2" I would strongly suspect that there was a value of "1"
available at sometime.

Secondly:

<quote>
...further study has revealed that I also need to omit the "Set" at the
beginning of the line, even though MSDN says that "Set" should be used.
Nonetheless, changing my code to:

            NewStr = rsSprocReturn.GetString(adClipString)
</quote>

Set is used to set a variable to be a reference to an object. .GetString()
does not return an object. .GetString() returns a string, which is
value-type not a reference-type. You would use Let, or omit it completely
(anything that does not have Set is an implicit Let)

Cheers
Ken

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
From: "Tab Alleman" <Tab.Alleman at MetroGuide.com>
Subject: RE: [thelist] VB6/ADO GetString compile error


Well, ya know, I did read the reference and was confuzzeled about the
StringFormat parameter.  It looks like it's required but there's only
one possible value?  My MSDN says this:

Parameters

StringFormat   Specifies that the Recordset should be converted to the
following format.

Constant Description
adClipString Rows are delimited by RowDelimiter, columns by
ColumnDelimiter, and NULL values by NullExpr. These three parameters are
valid only with adClipString.

So I have to go through the (apparent) formality of typing
"adClipString", since the first parameter is required, and it's the only
possible value for the first parameter?  How dumb.  :)

...further study has revealed that I also need to omit the "Set" at the
beginning of the line, even though MSDN says that "Set" should be used.
Nonetheless, changing my code to:

            NewStr = rsSprocReturn.GetString(adClipString)

...got me past the error.



More information about the thelist mailing list