Copying an Access table with DAO
Posted on 1998-11-11
I am trying to copy an Access table (DAO 3.5). There are several ways to do this, but I must point out that I am using Titan Access for Delphi 3 and so any BDE usage is out of the question. However, Titan does provide the same functions as the BDE, although the DbiCreateTable function is not implemented.
I have tried the following:
1. DAO "CopyObject" method. When I try this, the error message "OLE Automation Server does not support the CopyObject method." occurs. Has anybody managed to get this working?
2. BDE DbiCopyTable command. Because I am not using the BDE, but Titan, the error message "Engine not initialised" occurs, not surprisingly.
3. Titan's AccCopyTable method, which is identical to the BDE DbiCopyTable command. Error message: "DBIERR_NOTSUPPORTED". This is presumably because the Dbi_CreateTable command is not implemented as stated above, and I'm guessing that when copying a table, the CreateTable method is called first.
4. The actual TTable.CreateTable method. Nothing happens. No error message, no hanging, just nothing. When I step through the code, it just stops on that line but doesn't hang. I can still use the application.
5. The TTable.BatchMove method. See 4.
Anyone? I reckon the DAO CopyObject method MUST work somehow, but I'm not sure why delphi teels me it doesn't support it? Surely if I am using the OLE to talk to Access, then any Access commands should work. I used the CompactDatabase method and that worked fine.