[Visual Basic 6.0]Private Sub TableSearch(sde1CS As String, tableName As String, versionName As String)
'Direct connect
Dim gds1 As IGeoDataServerInit
Set gds1 = New GeoDataServergds1.InitFromConnectionString sde1CS
'**** Setup query filter ****
Dim qf As IQueryFilter
Set qf = New QueryFilter
qf.WhereClause = "OBJECTID < 5000"
'**** Setup ResultPortionInfo ****
Dim range As IResultPortionInfo
Set range = New ResultPortionInfo
range.StartIndex = 0 'Controls the start index for count
range.Count = gds1.MaxRecordCount 'Controls the number of rows to search
Dim gds As IGeoDataServer
Set gds = gds1
'**** Do TableSearch ****
Dim res As IGDSQueryResultPortion
Set res = gds.TableSearch(versionName, tableName, qf, range)
Debug.Assert Not res Is Nothing
Dim Log As LogFile
Set Log = New LogFile
'*** Save the initial tablesearch to a log file ***
Log.CreateFile App.Path + c_results1
Log.Log ""
Log.Log "Initial Results: " + vbNewLine + GdbUtils.PrintRecordSet(res.Records)'**** Setup IResultPortion ****
Dim resP As IResultPortion
Set resP = res
Debug.Assert Not resP Is Nothing
Dim resInfo As IResultPortionInfo
Set resInfo = resP.ResultPortionInfo
'*** Get the next result portion based on desired range count ***
Dim desiredRange As IResultPortionInfo
Set desiredRange = New ResultPortionInfo
desiredRange.Count = gds.MaxRecordCount
If range.Count > resInfo.Count Then
Debug.Print "Last result portion", vbInformation
Exit Sub
Else
range.StartIndex = range.StartIndex + resInfo.Count
End If
Set res = gds.GetNextResultPortion(range)
'*** Save the first of the next results to log file ***
Log.CreateFile App.Path + "\NextResult1.txt"
Log.Log ""
Log.Log "Next Results: " + vbNewLine + GdbUtils.PrintRecordSet(res.Records)End Sub
[Visual Basic .NET, C#, C++]
No example is available for Visual Basic .NET, C#, or C++. To view a Visual Basic 6.0 example, click the Language Filter button
in the upper-left corner of the page.