R
rob merritt
Hi
I am trying to create a web page (VB aspx) that users can http browse
to and get a tally of their appointments and their catagories (these
user track their work load by booking appt ments and classifying them
by appointment catagory)
here is teh code I found and modifided
<%@ Page Language="vb" %>
<%@ import Namespace="system.data" %>
<%@ import Namespace="ADODB" %>
<script runat="server">
' Insert page code here
'
Sub page_load()
Dim oCn As ADODB.Connection
Dim oRs As ADODB.Recordset
oCn = New ADODB.Recordset()
oRs= New ADODB.Connection()
Dim oFields As ADODB.Fields
Dim oField As ADODB.Field
' TODO: Replace with your folder URL
Dim sFdUrl As String
sFdUrl = "http://sps1s/Exchange/merrittr/Inbox"
oCn.Provider = "exoledb.datasource"
oCn.Open(sFdUrl, "", "", -1)
If oCn.State = 1 Then
Console.WriteLine("Good Connection")
Else
Console.WriteLine("Bad Connection")
Return
End If
' TODO: you may want to retrieve more properties
Dim strSql As String
strSql = ""
strSql = "select "
strSql = strSql + "
""urn:schemas:mailheader:content-class"""
strSql = strSql + ", ""DAV:href"" "
strSql = strSql + ",
""urn:schemas:mailheader:content-class"" "
strSql = strSql + ", ""DAV:displayname"""
strSql = strSql + " from scope ('shallow traversal of
" + """"
strSql = strSql + sFdUrl + """') "
strSql = strSql + " WHERE ""DAV:ishidden"" = false"
strSql = strSql + " AND ""DAV:isfolder"" = false"
oRs.Open(strSql, oCn, _
ADODB.CursorTypeEnum.adOpenUnspecified, _
ADODB.LockTypeEnum.adLockOptimistic, 1)
' Example: get the first message
' A loop could also be written to iterate through all
of the
messages!
oRs.MoveFirst()
' get Recordset fields
oFields = oRs.Fields
' List all fields
'Dim i As Integer
'For i = 0 To oFields.Count - 1
' oField = oFields.Item(i)
' Console.WriteLine("{0} : {1}", oField.Name,
oField.Value)
'Next
' Get item URL
Dim sURL As String
oField = oFields.Item("DAV:href")
sURL = oField.Value.ToString()
Console.WriteLine(sURL)
' You can also open the item with Message object
Dim iMsg As CDO.Message = New CDO.Message()
iMsg.DataSource.Open(sURL, oRs.ActiveConnection, _
ADODB.ConnectModeEnum.adModeReadWrite, _
ADODB.RecordCreateOptionsEnum.adFailIfNotExists, _
ADODB.RecordOpenOptionsEnum.adOpenSource, _
"", "")
Console.WriteLine("{0}", iMsg.Sender)
Console.WriteLine("{0}", iMsg.Subject)
Console.WriteLine("{0}", iMsg.TextBody)
' List message fields
oFields = iMsg.Fields
For i = 0 To oFields.Count - 1
oField = oFields.Item(i)
response.write.Write("{0} : {1}", oField.Name,
oField.Value)
Next
oRs.Close()
oCn.Close()
oCn = Nothing
oRs = Nothing
oFields = Nothing
oField = Nothing
'Use the line below to persist the console window for
examination
'Console.ReadLine()
End Sub
</script>
<html>
<head>
</head>
<body>
</body>
</html>
here is the error I get browsing to it.
******
Compiler Error Message: BC30002: Type 'ADODB.Connection' is not
defined.
Source Error:
Line 11:
Line 12:
Line 13: Dim oCn As ADODB.Connection
..
..
..
Microsoft (R) Visual Basic .NET Compiler version 7.10.3052.4
for Microsoft (R) .NET Framework version 1.1.4322.573
Copyright (C) Microsoft Corporation 1987-2002. All rights reserved.
C:\WINNT2K\Microsoft.NET\Framework\v1.1.4322\Temporary ASP.NET
Files\root\49af84b9\5dda2fd8\5cvysbfv.0.vb(14) : error BC30466:
Namespace or type 'ADODB' for the Imports 'ADODB' cannot be found.
Imports ADODB
~~~~~
C:\web\calendar\calendar.aspx(13) : error BC30002: Type
'ADODB.Connection' is not defined.
it suggests I dont have the ADODB lib installed even though I
explicitly did this:
c:\TlbImp.exe "C:\Program Files\Common Files\SYSTEM\ADO\msado15.dll"
Microsoft (R) .NET Framework Type Library to Assembly Converter
1.1.4322.573
Copyright (C) Microsoft Corporation 1998-2002. All rights reserved.
TlbImp warning: Primary interop assembly 'ADODB, Version=7.0.3300.0,
Culture=neu
tral, PublicKeyToken=b03f5f7f11d50a3a' is already registered for type
library 'C
:\Program Files\Common Files\SYSTEM\ADO\msado15.dll'.
Type library imported to ADODB.dll
any thoughts on me getting this going?
I am trying to create a web page (VB aspx) that users can http browse
to and get a tally of their appointments and their catagories (these
user track their work load by booking appt ments and classifying them
by appointment catagory)
here is teh code I found and modifided
<%@ Page Language="vb" %>
<%@ import Namespace="system.data" %>
<%@ import Namespace="ADODB" %>
<script runat="server">
' Insert page code here
'
Sub page_load()
Dim oCn As ADODB.Connection
Dim oRs As ADODB.Recordset
oCn = New ADODB.Recordset()
oRs= New ADODB.Connection()
Dim oFields As ADODB.Fields
Dim oField As ADODB.Field
' TODO: Replace with your folder URL
Dim sFdUrl As String
sFdUrl = "http://sps1s/Exchange/merrittr/Inbox"
oCn.Provider = "exoledb.datasource"
oCn.Open(sFdUrl, "", "", -1)
If oCn.State = 1 Then
Console.WriteLine("Good Connection")
Else
Console.WriteLine("Bad Connection")
Return
End If
' TODO: you may want to retrieve more properties
Dim strSql As String
strSql = ""
strSql = "select "
strSql = strSql + "
""urn:schemas:mailheader:content-class"""
strSql = strSql + ", ""DAV:href"" "
strSql = strSql + ",
""urn:schemas:mailheader:content-class"" "
strSql = strSql + ", ""DAV:displayname"""
strSql = strSql + " from scope ('shallow traversal of
" + """"
strSql = strSql + sFdUrl + """') "
strSql = strSql + " WHERE ""DAV:ishidden"" = false"
strSql = strSql + " AND ""DAV:isfolder"" = false"
oRs.Open(strSql, oCn, _
ADODB.CursorTypeEnum.adOpenUnspecified, _
ADODB.LockTypeEnum.adLockOptimistic, 1)
' Example: get the first message
' A loop could also be written to iterate through all
of the
messages!
oRs.MoveFirst()
' get Recordset fields
oFields = oRs.Fields
' List all fields
'Dim i As Integer
'For i = 0 To oFields.Count - 1
' oField = oFields.Item(i)
' Console.WriteLine("{0} : {1}", oField.Name,
oField.Value)
'Next
' Get item URL
Dim sURL As String
oField = oFields.Item("DAV:href")
sURL = oField.Value.ToString()
Console.WriteLine(sURL)
' You can also open the item with Message object
Dim iMsg As CDO.Message = New CDO.Message()
iMsg.DataSource.Open(sURL, oRs.ActiveConnection, _
ADODB.ConnectModeEnum.adModeReadWrite, _
ADODB.RecordCreateOptionsEnum.adFailIfNotExists, _
ADODB.RecordOpenOptionsEnum.adOpenSource, _
"", "")
Console.WriteLine("{0}", iMsg.Sender)
Console.WriteLine("{0}", iMsg.Subject)
Console.WriteLine("{0}", iMsg.TextBody)
' List message fields
oFields = iMsg.Fields
For i = 0 To oFields.Count - 1
oField = oFields.Item(i)
response.write.Write("{0} : {1}", oField.Name,
oField.Value)
Next
oRs.Close()
oCn.Close()
oCn = Nothing
oRs = Nothing
oFields = Nothing
oField = Nothing
'Use the line below to persist the console window for
examination
'Console.ReadLine()
End Sub
</script>
<html>
<head>
</head>
<body>
</body>
</html>
here is the error I get browsing to it.
******
Compiler Error Message: BC30002: Type 'ADODB.Connection' is not
defined.
Source Error:
Line 11:
Line 12:
Line 13: Dim oCn As ADODB.Connection
..
..
..
Microsoft (R) Visual Basic .NET Compiler version 7.10.3052.4
for Microsoft (R) .NET Framework version 1.1.4322.573
Copyright (C) Microsoft Corporation 1987-2002. All rights reserved.
C:\WINNT2K\Microsoft.NET\Framework\v1.1.4322\Temporary ASP.NET
Files\root\49af84b9\5dda2fd8\5cvysbfv.0.vb(14) : error BC30466:
Namespace or type 'ADODB' for the Imports 'ADODB' cannot be found.
Imports ADODB
~~~~~
C:\web\calendar\calendar.aspx(13) : error BC30002: Type
'ADODB.Connection' is not defined.
it suggests I dont have the ADODB lib installed even though I
explicitly did this:
c:\TlbImp.exe "C:\Program Files\Common Files\SYSTEM\ADO\msado15.dll"
Microsoft (R) .NET Framework Type Library to Assembly Converter
1.1.4322.573
Copyright (C) Microsoft Corporation 1998-2002. All rights reserved.
TlbImp warning: Primary interop assembly 'ADODB, Version=7.0.3300.0,
Culture=neu
tral, PublicKeyToken=b03f5f7f11d50a3a' is already registered for type
library 'C
:\Program Files\Common Files\SYSTEM\ADO\msado15.dll'.
Type library imported to ADODB.dll
any thoughts on me getting this going?