Hi everyone,
my scenario is this :
1. data connection connects to a sharepoint list / document library.
2. The results returned by the data connection must further be examined so that a subset of data will only be taken, which is based on conditions/parameters set by user.
3. Code done in VBscript.
is it possible to query the mentioned data connection?
As I have seen in some posts, this can be done via ADOQueryConnection, which is only applicable to data connections using SQL database. Just plug in the SQL statement then viola, results are returned. (as stated in this help file: ms-help://MS.VSTACC.v80/MS.IPVSTA12.12.1033/IPVSTA12/html/4b06c377-52fc-ffeb-7b15-d5fb0e286da5.htm)
'----------------------------Code in help file ----------------------------------------------------
' Get the Employees connection from the
' DataConnections collection.
Dim myAdoQueryConnection As AdoQueryConnection = DirectCast(Me.DataConnections("Employees"), AdoQueryConnection)
' Get the employee's ID from the EmpID field in
' the main data source.
Dim myNav As XPathNavigator = CreateNavigator().SelectSingleNode("/my:myFields/my:EmpID", NamespaceManager)
Dim employeeID As String = myNav.InnerXml
' Change the SQL command for Employees connection to retrieve
' the record of the Employee's ID entered by the user.
myAdoQueryConnection.Command = "select * from [Employees] where [EmployeeID] = " + employeeID
' Execute the updated command against the data connection to
' refresh the data.
myAdoQueryConnection.Execute()
'----------------------------End of Code-------------------------------------------------------------------
But my backend data store is sharepoint. What code / class do i need to use to do this?
If yes, can you also have these results sorted the way you wanted? (coz this will speed up my data manipulation)
If you have/can share these codes its much appreciated!
Jon