DBXanalyzer API
DBXazapi is an application programming interface (API) that provides you with the ability to query and extract data from a version 5 or 6 Microsoft Outlook Express DBX file using a variety of programming languages, including C, C++, C#, VB6, VBA, VB.NET, VBScript and ASP. DBXazapi is a separate program and is independent of its sister DBXanalyzer GUI program.
Example in C to print the subject line for each message in a DBX file:
#include "DBXazapi.h"
long lRet;
const char *dbxfile = "Test.dbx";
char buf[256];
long nitems, i;
nitems = DBX_Count(dbxfile);
for (i = 0; i < nitems; i++)
{
lRet = DBX_GetSubject(buf, sizeof(buf)-1, i, dbxfile);
if (lRet > 0)
printf("%d: [%s]\n", i, buf);
else
printf("DBX_GetSubject returns %ld\n", lRet);
}
Example in ASP to print out the time received of each email:
Set oDbx = Server.CreateObject("DBXazCom.dbx")
strFileName = "C:\Test\Test.dbx"
nCount = oDbx.Count(strFileName)
For i = 0 to nCount - 1
strTimeReceived = oDbx.GetTimeReceived(i, strFileName)
Response.Write(i & "=" & strTimeReceived & vbCrLF)
Next
Example in C# to find the first email with 'simple' in its subject and then print out its entire message text:
using DBXanalyzer;
const string dbxfile = "Test.dbx";
int n, i;
string s, qry;
// Find first email with 'simple' in the subject
Console.WriteLine("Find first email with 'simple' in the subject...");
qry = "Subject = 'simple'";
n = Dbx.Find(qry, 0, dbxfile);
Console.WriteLine("Dbx.Find('{0}') = {1}", qry, n);
Debug.Assert(n > 0, "Dbx.Find failed" );
// Get the full message text
Console.WriteLine("Get its message text...");
s = Dbx.GetMessage(n, dbxfile);
Console.WriteLine("Message=\n[{0}]", s);
Debug.Assert(s.Length > 0, "Failed to get the message text");
Example in VB.NET to find the most recent message received:
Imports DBXanalyzer
Const dbxfile As String = "Test.dbx"
Dim n As Integer
Dim s As String
' When was the most recent message received
Console.WriteLine("When was the most recent message received...")
s = Dbx.MaxTimeReceived(dbxfile)
Console.WriteLine("Dbx.MaxTimeReceived={0}", s)
Debug.Assert(s.Length > 0, "Failed to get MaxTimeReceived")
' Which message was it
Console.WriteLine("Which message was it...")
n = Dbx.IndexMaxTimeReceived(dbxfile)
Console.WriteLine("Dbx.IndexMaxTimeReceived={0}", n)
Debug.Assert(n > 0, "Dbx.IndexMaxTimeReceived failed")
View the programmers' manual (16 kB) which is included in the download.
Download a trial version of the DBXazapi (232 kB). It includes the core Win32 DLL, an ActiveX wrapper DLL, and a .NET class library. The source code for the ActiveX and .NET class libraries is included as well as example programs in C, ASP, VB.NET and C#. This trial version (v 1.2.0.2 re-compiled and digitally-signed) will expire at the end of June 2010 (we may discontinue the product then, so if you are intending to buy, do it soon). Please read and agree to the Trial Licence Conditions before using.
The cost of a licensed version of DBXazapi is US$109 and it has these Developer Licence Conditions. More details on how to purchase are available here. Please contact us for more details. There is a discount for holders of an existing DBXanalyzer licence.
If you experience any problems with the API, please email us.
This page last updated: 9 June 2010