|
|
|
date: Fri, 9 Jun 2006 11:42:45 -0500,
group: microsoft.public.exchange.development
back
How to query for custom field in public folder?
Hello,
In a public folder I have defined custom fields; now I want to query the
folder for those fields. The following code (in VB6) works, but the
recordset does not have my custom columns, only the standard ones.
---------------
Set ADOConn = New ADODB.Connection
Set ADORS = New ADODB.Recordset
ADOConn .Provider = "Microsoft.JET.OLEDB.4.0"
ADOConn .Open "Exchange 4.0;MAPILEVEL=Public Folders|\All Public
Folders;TABLETYPE=0;DATABASE=C:\TEMP\"
ADORS.Open "SELECT * from MYPUBLICFOLDER", ADOConn, adOpenStatic,
adLockReadOnly
---------------
if I specify SELECT MYFIELD instead of SELECT *, it returns error "No value
given for one more more required parameters".
Is there a way to query for custom fields? The ultimate purpose of this is
autonumbering of posts in the folder - ideally, I would issue SELECT
MAX(MYFIELD)+1 and assigne it to MYFIELD in the newly-created post.
thanks,
Vadim Rapp
date: Fri, 9 Jun 2006 11:42:45 -0500
author: Vadim Rapp
Re: How to query for custom field in public folder?
The OLEDB connection only gives you access to a subset of the properties for
any item type (only about 44 properties for a contact item for example) and
no access to user defined properties.
You can take a look at Michael Kaplan's article about adding other fields to
an Outlook OLEDB connection, but I've never gotten it to work myself.
--
Ken Slovak
[MVP - Outlook]
http://www.slovaktech.com
Author: Absolute Beginner's Guide to Microsoft Office Outlook 2003
Reminder Manager, Extended Reminders, Attachment Options
http://www.slovaktech.com/products.htm
"Vadim Rapp" wrote in message
news:uzL%23%23O%23iGHA.3588@TK2MSFTNGP02.phx.gbl...
> Hello,
>
> In a public folder I have defined custom fields; now I want to query the
> folder for those fields. The following code (in VB6) works, but the
> recordset does not have my custom columns, only the standard ones.
>
> ---------------
> Set ADOConn = New ADODB.Connection
> Set ADORS = New ADODB.Recordset
> ADOConn .Provider = "Microsoft.JET.OLEDB.4.0"
> ADOConn .Open "Exchange 4.0;MAPILEVEL=Public Folders|\All Public
> Folders;TABLETYPE=0;DATABASE=C:\TEMP\"
> ADORS.Open "SELECT * from MYPUBLICFOLDER", ADOConn, adOpenStatic,
> adLockReadOnly
> ---------------
>
> if I specify SELECT MYFIELD instead of SELECT *, it returns error "No
> value given for one more more required parameters".
>
> Is there a way to query for custom fields? The ultimate purpose of this is
> autonumbering of posts in the folder - ideally, I would issue SELECT
> MAX(MYFIELD)+1 and assigne it to MYFIELD in the newly-created post.
>
> thanks,
>
> Vadim Rapp
date: Mon, 12 Jun 2006 09:03:42 -0400
author: Ken Slovak - [MVP - Outlook]
|
|