PRB: RDS May Return E_FAIL Status when Querying Index Server
ID: Q241794
|
The information in this article applies to:
-
Microsoft Index Server version 2.0
-
Remote Data Service for ADO versions 2.0, 2.01, 2.1
SYMPTOMS
Using the Data Factory in Remote Data Service 2.0 (or 2.1) to query Index Server for the document titles (DocTitle field) generates the following error:
The data provider or other service returned an E_FAIL status.
The same error will result for any of the Doc* properties or user-defined properties.
CAUSE
Index Server does not hard-code the datatype for DocTitle as a string. Thus the
return value is recognized as a VARIANT. Remote Data Service is known to fail when handling the DBTYPE_VARIANT
datatype for a property retrieved in OLE DB. Returning such a type with Remote Data Service results in the E_FAIL status error.
RESOLUTION
Remove DocTitle from the Index Server query.
-or-
Use ActiveX Data Objects (ADO) to query for the DocTitle.
MORE INFORMATION
Steps to Reproduce Behavior
- Start a new Visual Basic project.
- Reference Remote Data Service and ADO libraries.
- Add a command button to Form1.
- Paste the following code in the Form1 general declaration (change HTTPServer as appropriate):
Option Explicit
Dim RS As ADODB.Recordset
Dim DS As New RDS.DataSpace
Dim DF As Object
Dim sSQL As String
Const HTTPServer As String = "myServer"
Const Scope As String = "C:\"
Const QueryText As String = "Index Server"
Private Sub Command1_Click()
sSQL = "SELECT Filename, Vpath, DocTitle FROM Scope('" + Chr(34) + _
Scope + Chr(34) + "') WHERE CONTAINS('" + Chr(34) + QueryText + _
Chr(34) + "') > 0 ORDER BY Rank DESC"
Set DF = DS.CreateObject("RDSServer.DataFactory", "http://" & HTTPServer)
Set RS = DF.Query("Provider=msidxs", sSQL, adOpenDynamic)
Do Until RS.EOF
Debug.Print RS("Filename"), RS("Vpath"), RS("DocTitle")
RS.MoveNext
Loop
RS.Close
Set RS = Nothing
End Sub
REFERENCES
Additional query words:
kbgrpvbdb kbgrpmdac kbIdxServ200 kbdsupport kbdatabase
Keywords : kbADO200 kbADO201 kbADO210 kbDatabase kbIdxServ kbIdxServ200 kbRDO kbRDS kbGrpVCDB kbGrpMDAC kbDSupport
Version : WINDOWS:2.0,2.01,2.1; winnt:2.0
Platform : WINDOWS winnt
Issue type : kbprb