somnath_it2006
Well-known Member
- Joined
- Apr 11, 2009
- Messages
- 574
Hi All,
I am trying to extract data from SharePoint list to excel using ado recordset.
Below steps I have taken in this procedure:
1. Load xml data of SharePoint list in DOMDocument object
2. Write that xml data in ADODB.Stream object
3. Open recordset on that ADODB.Stream object
And then I use that recordset data to generate some reports.
Now my problem is I am not able to excecute the SQL query on that recordset or xml data.
That recordset contains 20000 rows of data so it's taking too much of time to go through each record.
I want to run the SQL query on that recordset.
If you know something please help me on this...
Below is the code I am using:
Please tell me if you require more specifications...
I am trying to extract data from SharePoint list to excel using ado recordset.
Below steps I have taken in this procedure:
1. Load xml data of SharePoint list in DOMDocument object
2. Write that xml data in ADODB.Stream object
3. Open recordset on that ADODB.Stream object
And then I use that recordset data to generate some reports.
Now my problem is I am not able to excecute the SQL query on that recordset or xml data.
That recordset contains 20000 rows of data so it's taking too much of time to go through each record.
I want to run the SQL query on that recordset.
If you know something please help me on this...
Below is the code I am using:
Code:
Sub test()
Dim xmlDoc As DOMDocument
Set xmlDoc = New DOMDocument
xmlDoc.async = False
'============= Step 1 =============
' Load xml into DOMDocument object
'==================================
xmlDoc.Load ("http://SharepointSite/_vti_bin/owssvr.dll?Cmd=Display&List={f0fd1ddb%2Dc9a4%2D44ac%2Daaec%2D5b9fe952acdf}&XMLDATA=TRUE&RowLimit=0")
'==================== Step 2 =================
' Write that xml data in ADODB.Stream object
'=============================================
Dim oStream As ADODB.Stream
Set oStream = New ADODB.Stream
oStream.Open
oStream.WriteText xmlDoc.XML
oStream.Position = 0
'==================== Step 3 =================
' Open recordset on that ADODB.Stream object
'=============================================
Dim rs As ADODB.Recordset
Set rs = New ADODB.Recordset
[COLOR="Red"]' I want to run SQl statement here
rs.Open oStream[/COLOR]
End Sub
Please tell me if you require more specifications...
Last edited: