Board index » delphi » Difference between Access 2003 and Access 2007

Difference between Access 2003 and Access 2007


2008-01-26 01:09:56 AM
delphi261
I have inherited a project that has historically made use of an Access
database. Through Access 2003, there have been no database issues.
However, Access 2007 (currently loaded on XP) seems to be giving me
some trouble. Specifically, I believe that I have narrowed it down to
one particular call. The series of calls is as follows:
AccessApp := CoAccessApplication.Create;
AccessApp.OpenCurrentDatabase(FsDBPath, False, sPassword);
AccessApp.DoCmd.RunSQL(FsSql, False);
The last line in this block causes the exception
The RunSQL action was cancelled
The SQL command it is running is something like this (names changed to
protect the innocent):
'INSERT INTO Table ( Col1, Col2, Col3) SELECT Col1, Col2, Col3
FROM [Text;HDR=YES;DATABASE=C:\].[File.CSV]'
I have added the following commands to quell the warning message
AccessApp.DoCmd.SetWarnings(False);
AccessApp.DoCmd.RunSQL(FsSql, False);
AccessApp.DoCmd.SetWarnings(True);
But this has not quelled the warnings. As well, I have tried the
following commands
AccessApp.CurrentDb.ExecuteSQL(FsSql);
and
AccessApp.CurrentDb.Execute(FsSql,True);
Yet these produce the error
Invalid argument
On both Access 2007 as well as a working system of Access 2003.
I am stumped at this point. Any ideas?
Thanks!
 
 

Re:Difference between Access 2003 and Access 2007

Never mind, my bad.
I did not set up my Trusted Zones, so the INSERT was failing.
All is well now.