exchangefreaks.com Forum Index
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister   ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

ADO queries always fail?

 
Post new topic   Reply to topic    exchangefreaks.com Forum Index -> MS Exchange Design
Author Message
Maury Markowitz



Joined: 14 Feb 2008
Posts: 12

PostPosted: Thu Feb 14, 2008 7:33 pm    Post subject: ADO queries always fail? Reply with quote

Here's my code, verbatim:

conn = ("Provider=Microsoft.Jet.OLEDB.4.0;Exchange 4.0;MAPILEVEL=Public
Folders|All Public Folders;DATABASE=C:\\Temp\\;")
Set rstEmails = New ADODB.Recordset
rstEmails.Open "SELECT * FROM pricing WHERE ""Has Attachments""=1", conn,
adOpenStatic, adLockReadOnly
While Not rstEmails.EOF
Debug.Print rstEmails!Subject
rstEmails.MoveNext
Wend

The "pricing" folder has three files in it, two of which have attachments. I
want to get all of the ones that have attachments.

Most of what I trye after the ""Has Attachments""= returns a data type
mismatch...

""Has Attachments""=1
""Has Attachments""=yes

The only one that works is...

""Has Attachments""=true

But when I use that, I get all the messages, not just the ones with the
attachments. So I tried another tack..

rstEmails.Open "SELECT * FROM pricing WHERE recieved>='" & date & "'",
conn, adOpenStatic, adLockReadOnly

data type mismatch.

Is there some secret I need to know?

Maury

Archived from group: microsoft>public>exchange>design
Back to top
View user's profile Send private message
Maury Markowitz



Joined: 14 Feb 2008
Posts: 12

PostPosted: Thu Feb 14, 2008 7:43 pm    Post subject: RE: ADO queries always fail? Reply with quote

"Maury Markowitz" wrote:

Ok, even weirder... I sent a message with the body text "test". When I open
the folder as a linked table, I can see a column called "Body", and for that
message, it says "test". So, let's query that...

rstEmails.Open "SELECT * FROM pricing WHERE Body='test'", conn,
adOpenStatic, adLockReadOnly

Returns EOF.

Huh?

Maury
Back to top
View user's profile Send private message
Maury Markowitz



Joined: 14 Feb 2008
Posts: 12

PostPosted: Thu Feb 14, 2008 7:49 pm    Post subject: RE: ADO queries always fail? Reply with quote

Geez, finally got it. Square braces only, ""'s don't work. Urg.

Maury

Back to top
View user's profile Send private message
Display posts from previous:   
Related Topics:
Beginner interpretation of queries How can I display what the following filter does? (&(&(& (| )))) I'm guessing it returns all users who have mailboxes. But how can I take a query like this

when did the cluster fail over? We have an Exchange 2003 SP2 2 node cluster. The Exchange resource group (containing all services + disk resources) failed over to its peer node - we never noticed it. I'm looking through the cluster log file in for when & why it failed

SCR Target fail over error I have a SCC cluster with NODEA and NODEB that make up EXCLUS. I am following the walkthrough at this link. I have successfully enabled SCR to NODEC. NODEC has the Mailbox Server Role ins

OWA Login is beginning to fail We are running Exchange 2k on a Windows 2k domain. We have just one Exchange server and the users have been using OWA with no problems until recently. Now on some machines only the user that is logged into the domain is the only one able to login to OWA

MAPIInitialize(NULL) used to fail after 10-15 successfully a Hi Everyone, I posted a similer query 10 days back but there was no responce to that. here with i am resending similer query. please help in in resolving this issue. I am facing some issues with MAPI. I am trying to get mailbox information from 2000/2003
Post new topic   Reply to topic    exchangefreaks.com Forum Index -> MS Exchange Design All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group