The functions in the DBXanalyzer API allow you to query and extract data from a version 5 or 6 Microsoft Outlook Express DBX file using a variety of programming languages.
In all cases, messages are referenced by an index number between 0 and N-1 where N is the number of messages in the file. There are functions to query the DBX file and find the required index number, and functions to extract information and messages. All functions are read-only as far as the DBX file is concerned, so you cannot damage your email store by using this API.
The actual value of the index is set internally by Outlook Express and bears no relation to any particular order. Do not assume it will remain the same for a given message after the DBX file has been updated. Deleted messages are ignored and cannot be accessed.
DBXazapi.dll which is a simple Win32 DLL. This file must
exist on the user's system for all programming language interfaces.
DBXazapi.dll is not registered with Regsvr32 (it can't be).
To install, just copy to a directory on the user's system in the library search path.
This can be the same directory as the executable that is calling it,
or a directory in the PATH environment setting,
but
the easiest place is the %windows\system% directory which will allow it to be found by anything.
DBXazCom.dll is an ActiveX DLL which exposes the dbx class to allow
programming access from ASP, VBscript and other COM applications including VB.
This DLL does require registering.
To register, copy the DBXazCom.dll to a convenient folder, open a command-line
window, and type
REGSVR32 DBXazCom.dll
DBXazNet.dll is a .NET Class Library which exposes the Dbx class
to allow programming access from C# and VB.NET projects.
This file is referenced from your .NET project. It is not registered.
DBXazapi.h in your source code and link to DBXazapi.lib.
#include "DBXazapi.h"The C interface accesses the functions in the core DLL directly and only requires that the Win32
DBXazapi.dll file exists in the system's library search path.
See the examples in t_DBXazapi.c and the notes below.
The DBXazapi.lib library provided was compiled
using MSVC++5 and should work with versions 5, 6, 7, and 8 (2005 Express) of Visual C++.
implib DBXazapi.lib DBXazapi.dll
DBXazNet.dll library file into a convenient folder.DBXazNet.dll.using DBXanalyzer;or (for VB.NET)
Imports DBXanalyzerto your code.
DBXanalyzer.cs in your project
and there is no need to reference the class library.
DBXazCom.dll ActiveX DLL (Project>References>Browse).DBXazapi.tlb.String function. See the source code of DBXazCom for examples
and the notes below.
Dim oDbx
Set oDbx = Server.CreateObject("DBXazCom.dbx")
nVersion = oDbx.Version()See Methods.
' ONE-OFF FILE FUNCTIONS nRet = DBX_Count(strFileName) nRet = DBX_GetSubject(strBuf, nMaxChars, nIndex, strFileName) nRet = DBX_GetTimeReceived(strBuf, nMaxChars, nIndex, strFileName) nRet = DBX_GetMessageId(strBuf, nMaxChars, nIndex, strFileName) nRet = DBX_GetMessage(strBuf, nMaxChars, nIndex, strFileName) nRet = DBX_Find(strCriteria, nStartIndex, strFileName) nRet = DBX_MaxTimeReceived(strBuf, nMaxChars, strFileName) nRet = DBX_IndexMaxTimeReceived(strFileName) nRet = DBX_Size(strFileName) ' GENERAL FUNCTIONS nRet = DBX_Version() nRet = DBX_LastError(strBuf, nMaxChars) nRet = DBX_ErrorLookup(strBuf, nMaxChars, nErrCode)
[NOT] keyword OP quoted-string (AND|OR [NOT] keyword OP quoted-string)*OP can be one of the six VB-like relational operators, namely:
=, >, <, >=, <=, or <>with no spaces allowed inside the double ones. String must be quoted in single quotes ('). Use backslash (\) to escape single quotes and itself in the string. Examples:-
"Subject='foo'" "Received > '2004-12-31 23:59:59'" "Not Received >= '2004-12-31 23:59:59' And Subject='foo'" "Received < '2004-12-31 23:59:59' Or Subject='bar'" "Received >= '2004-12-31 23:59:59' And Subject='foo' or from= 'bar' " "Received < '2004-12-31 23:59:59' Or NOT Subject='bar'" "Subject='With \'quotes\' inside'" "Subject <> 'foo' OR FROM='bar' AND Received > '2004-12-31'"The input is parsed from left-to-right and AND has a higher precedence than OR so
a AND b OR c is interpreted as (a AND b) OR c a OR b AND c is interpreted as a OR (b AND c) a AND b OR c AND d OR e = (a AND b) OR ((c AND d) OR e)Supported keywords are:
RECEIVED SUBJECT MESSAGEID TO FROM TOADDR FROMADDRAll keywords and searches are case insensitive. Wildcards (*?) are NOT supported but are implied, so
SUBJECT='foo'is interpreted as
SUBJECT='*foo*'
and will find "foo", "Foo bar", "more FOO", "April Fool".
The greater-than/less-than operators are only valid for the keyword RECEIVED which
compares lexicographically up to length of the search string.
This may give weird results for a badly-formed date.
Dates must be in the ISO format "yyyy-mm-dd hh:nn:ss" with a single space between the date and time.
0=OK, success, no error 1=Cannot open input file 2=Cannot create output file 3=File read error 4=File write error 5=Memory error 6=Invalid handle 7=Data is in wrong format 8=Invalid DBX signature 9=Not a DBX message store 10=Index not in valid range 11=Parsing error 12=Error in criteria 13=No match found
Version 1.1.1. This page last updated 1 January 2008.
David Ireland