delphi developers' Journal (original) (raw)

10:53a

Problem with opening database I've got a bit of code that's giving me an invalid argument error and I can't work out why. It worked in Delphi 3, but now I've upgraded to version 7 it doesn't. Basically I am trying to open and Access database with the following lines;

dbeNew := codbEngine.create;
strfilename := self.dlgopen.FileName;
dbNew := dbeNew.OpenDatabase(strfilename,0, FALSE,'');

The filename is coming from an open dialog box, and I have checked that it is not pulling through an empty string or anything like that. The invalid argument error comes on the third line.

Can anybody help?