IDispatch Error #3127 when executing InsertSQL statement

G

Ganga Sridhar

Platform : Windows2000, XP,
Microsoft Visual C++ .NET (Version 7.1), MS Access (Office 2003), ADO

Hi,
Through my application I need to create a complete database using a source
database and copy the data from it.
I am achieving this by
1) Opening ADO connection to both the source and destination databases.
2) Creating each table one by one in the destination database. I am using
_TablePtr to create these tables in MSAccess.
3) Creating indexes on each table
4) Executing Insert SQL statements on each table
GetConnPtr()->Execute(strSQL.c_str(),NULL, MSADO21::adCmdText);

When I execute my application (release build) directly I get the following
error :
"IDispatch Error #3127" reported by Microsoft Jet Database Engine. The
problem reported was that the output table could not be found.

Please Note :
1) The output table which it reports not to have found is actually present
in the destination database.
2 ) When I execute this same (Release) code with a break point breaking just
before the Execute Insert SQL statement everything works fine without any
errors.
As a matter of fact if a put a Sleep(1000) statement before executing the
SQL things work fine even in the normal application.

Am not sure what could have gone wrong?
Any suggestions or any commonly found problem in this area that could be
leading to this?

Any pointers would be of great help

Thanks and Regards
Ganga
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top