VincentF

I'm using XP and WDS 3.01

When I query for System.Author it gets an error when writing the value.

Error: Type mismatch

I can get all other types (System.Title, System.Subject) and so on

Simple OLEDB + VBScript Example:

"SELECT Top 10 System.ItemName, System.Title, System.Author FROM SystemIndex"

document.write rs("System.ItemName")

document.write rs("System.Title")

document.write rs("System.Author")

Everytime it encounters System.Author there's an error.

I'm catching nulls and empty values.

Tried cStr(rs("System.Author") with no luck.

Also tried VB.Net and it returns System.String[] as the value.

Any suggestions



Re: Windows Desktop Search Development WDS Query System.Author problem

Jeff Zhang (MSFT)

Could you please verify that the data of System.Author is not null A quick way is to right-click the file, and choose properties to show its property sheets. Then choose "Summary" tab. If it is null, you may need to check if that write method accepts null or not.
Thanks.





Re: Windows Desktop Search Development WDS Query System.Author problem

VincentF

Hi Jeff,

Like I said, I'm catching the nulls. So that's fine.

I did a little more research,

System.Author and System.Keywords used to be (type="VT_LPWSTR") a string, and I would just output the data.

Now they are (type="VT_LPWSTR | VT_VECTOR") which is array of strings.

If I output varType(rs("System.Author") I get "8200", Array String

If I output rs("System.Author").type I get "12", adVariant

So it seems I have to loop through an array or collection.

The problem is that what ever I throw at it gives me an error and I've been looking for some type of sample with no luck.

It makes sense that MS would change these to arrays. Especially Keywords because they are typically multi-value fields and seems more efficient.

I would appreciate some sample code for vb to get the values.

-Thanks





Re: Windows Desktop Search Development WDS Query System.Author problem

Jeff Zhang (MSFT)

There is a change since WDS 3.0 that some properties like System.Author changes from a string "a, b, c" to a string vector, and I think that is the root cause. But unfortunately, I have little knowledge on how to hanlde it in VB. You could search PropVariant for more information on VT_VECTOR since it is not available for Variant.
Thanks.




Re: Windows Desktop Search Development WDS Query System.Author problem

Eric Wolz - MSFT

You need to treat this as an array of strings. Does this not work

Number of item in the array: System.Author.Length

MsgBox("Author = " & System.Author(0))
MsgBox("Author = " & System.Author(1))

MsgBox("Author = " & System.Author(2))

etc...

http://msdn2.microsoft.com/en-us/library/ms235277(VS.80).aspx






Re: Windows Desktop Search Development WDS Query System.Author problem

VincentF

My thoughts exactly, I tried treating it as a basic array of strings.

arrAuthors() = rs("System.Author")
msgbox arrAuthors(0)

--Error Type Mismatch line 1

arrAuthors = Array(rs("System.Author"))
msgbox arrAuthors(0)

--Error Type Mismatch line 1

If isArray(rs("System.Author")) then
arrAuthors = Array(rs("System.Author"))
msgbox arrAuthors(0)
End If

--Error Type Mismatch line 2

I tried all sorts of array functions. Something tells me that the recordset is thowing out some type of Object.

Just have to find a way of converting it into a basic array, then loop through.

I would love to see a confirmed snippet of code to get a value from these types of fields.

I'll keep trying!

-Thanks





Re: Windows Desktop Search Development WDS Query System.Author problem

Eric Wolz - MSFT

I'm not a VB developer, so someone else would need to jump in and help you out. I know that we do adhere to OLEDB data types and this property is a vector array.






Re: Windows Desktop Search Development WDS Query System.Author problem

VincentF

I think I found something. I'm not positive if this article is connected in some way.

Is this possible Could someone please confirm if this article is connected to the problem I'm having

http://support.microsoft.com/kb/237536

From the link above:

An error occurs because the fields in the disconnected recordset have been defined as adVariant, and ADO cannot marshal certain data types within adVariant across process boundaries (in this case, between InetInfo and MTS or COM+). ADO marshaling cannot convert data of the following types when the field type is set to adVariant:
DBTYPE_BSTR = 8,
DBTYPE_IDISPATCH = 9,
DBTYPE_VARIANT = 12,
DBTYPE_IUNKNOWN = 13,
DBTYPE_ARRAY = 0x2000,
DBTYPE_BYREF = 0x4000,