VB Code:
Dim oRec As ADODB.Record Dim sUrl As String Dim sSQL As String Dim oRst As ADODB.Recordset Dim Flds As ADODB.Fields Dim Fld As ADODB.Field Private Sub Command1_Click() sUrl = "http://smtp.mywebsite.com/public/New Projects" sSQL = "select " sSQL = sSQL & " ""DAV:contentclass""" sSQL = sSQL & ", ""urn:schemas:contacts:o"" " sSQL = sSQL & ", ""DAV:href"" " sSQL = sSQL & ", ""DAV:displayname"" " sSQL = sSQL & ", ""DAV:company"" " sSQL = sSQL & " from scope ('shallow traversal of " & Chr(34) sSQL = sSQL & sUrl & """') " sSQL = sSQL & " WHERE ""DAV:ishidden"" = false " sSQL = sSQL & " AND ""urn:schemas:contacts:o"" LIKE '%dim%' " oRec.Open sUrl, , adModeRead oRst.Open sSQL, oRec.ActiveConnection List1.AddItem "Public Folders :" Do While Not oRst.EOF List1.AddItem oRst.Fields("DAV:href") oRst.MoveNext Loop oRst.Close oRec.Close End Sub Private Sub Form_Load() Set oRec = CreateObject("ADODB.Record") Set oRst = CreateObject("ADODB.Recordset") End Sub
I'm trying to convert that from VB6 to .NET but I keep getting this error in .net:
Code:Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code. Exception Details: System.Runtime.InteropServices.COMException: Source Error: Line 49: sSQL = sSQL & " AND ""urn:schemas:contacts:o"" LIKE '%dim%' " Line 50: Line 51: oRec.Open(sUrl, , ADODB.ConnectModeEnum.adModeRead) Line 52: oRst.Open(sSQL, oRec.ActiveConnection) Line 53: list1.Items.Add("Public Folders :")
Any ideas guys?
thanks in advance,
Dimava




Reply With Quote