|
-
Jun 16th, 2004, 02:58 PM
#1
Thread Starter
Frenzied Member
from VB6 to .Net
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
NXSupport - Your one-stop source for computer help
-
Jun 24th, 2004, 11:23 AM
#2
Addicted Member
Set ASPCompat to true for your aspx page. Will be in the properties box for the page object
-
Jun 24th, 2004, 10:23 PM
#3
PowerPoster
Originally posted by rdove
Set ASPCompat to true for your aspx page. Will be in the properties box for the page object
you are evil...lol
The truth is, you should go ahead and learn ADO.Net now. This is such a simple thing to do, but you have to spend the time doing it. ASP.NET is NOT the same as ASP 3.0. You can do the compatibility thing, but why? Rewrite that code to use a connection object, a command object, and use databinding to get the data into the list. Look in the System.Data.... namespace
-
Jun 24th, 2004, 11:39 PM
#4
Addicted Member
Originally posted by hellswraith
you are evil...lol
The truth is, you should go ahead and learn ADO.Net now. This is such a simple thing to do, but you have to spend the time doing it. ASP.NET is NOT the same as ASP 3.0. You can do the compatibility thing, but why? Rewrite that code to use a connection object, a command object, and use databinding to get the data into the list. Look in the System.Data.... namespace
I totally agree
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|