Wihiss
May 28th, 2003, 07:00 AM
Help!
I try to use Access DB via ADO (ADOX) under VC.Net.
I make the following steps:
1. Create an empty DB (using ADOX::Catalog->Create() method);
2. Append the tables to database (create a new ADOX::Table object and append it to ADOX::Tables collection);
3. Create a new relationship (a foreign key for any table). I use ADO::Connection->Execute method and try to use the SQL string like:
"ALTER TABLE [A] ADD FOREIGN KEY ( [A1] ) REFERENCES [B] ( [B1] )"
If I do a pause (2-3 sec) between poin 2 and 3 (using breakpoint or MessageBox), this scenario works correctly. But if I do not make any pauses between points 2 and 3, I get the error message:
"Error number 80040e37 Cannot find table or constraint."
Help!!! :confused:
I try to use Access DB via ADO (ADOX) under VC.Net.
I make the following steps:
1. Create an empty DB (using ADOX::Catalog->Create() method);
2. Append the tables to database (create a new ADOX::Table object and append it to ADOX::Tables collection);
3. Create a new relationship (a foreign key for any table). I use ADO::Connection->Execute method and try to use the SQL string like:
"ALTER TABLE [A] ADD FOREIGN KEY ( [A1] ) REFERENCES [B] ( [B1] )"
If I do a pause (2-3 sec) between poin 2 and 3 (using breakpoint or MessageBox), this scenario works correctly. But if I do not make any pauses between points 2 and 3, I get the error message:
"Error number 80040e37 Cannot find table or constraint."
Help!!! :confused: