Using ADO to connect to Outlook/Exchange



Hi all,

I'm using Borland Delphi 5 Build 5.62 and I'm having trouble viewing data in
my dbgrid.
I can see the column names, but the data is blank. I have rechecked that I
have the folder name is
correct and there is mail in that folder by simply going into Outlook.

Below is my code.

procedure TForm1.Button8Click(Sender: TObject);
var connstr:string;
i:integer;
sl : TStrings;
begin
connstr := 'PROVIDER=Microsoft.Jet.OLEDB.4.0;'+
'EXCHANGE 4.0;'+
'MAPILEVEL=;'+
'DATABASE=C:\Temp;';

ADOConnection1.ConnectionString := connstr;
ADOConnection1.Connected := true;
sl := TStringList.Create;
try
ADOConnection1.GetTableNames( sl);
ADOQuery1.SQL.text := 'Select * from [' + sl.Strings[0] + ']';
ADOQuery1.Open;
ShowMessage('done');
end;
finally
sl.free;
end;

end;

Apart from getting blank records.

* I get "Either Bof or Eof is true, or the current record has been deleted"
when I exit out of the application," whenever I try to close the query.

I made a search on the internet, and read a Delphi 5 bug had a workaround by
setting the cursorlocation is set to clUUserClient.
But I still get the error message nonetheless.

p.s I log in with empty password and login. I've tried to connect with my
login name. but I get
"The workgroup information file is missing or opened exclusively by another
user".


Any ideas?

Andrew


.


Quantcast