// JP opened flex table

Click to See Complete Forum and Search --> : MultiThread and ODBC


Bruno Matrtin
July 7th, 1998, 12:33 PM
I'm trying to open an ODBC database from a thread and i have alway the same message telling me that i have a Access Violation...


UINT RequeteInsertion(LPVOID pParam)

{

CDBDatabase db;

db.Open("MY BASE");

db.ExecuteSQL("INSERT INTO DonneesSimuleHydroT SELECT * FROM DonneesSimuleHydroT1;");

db.Close();

return 0;

}


This code looks fine to me, but the fu... doesn't take it... Where the Access violation here, i have no const value .... HELP PLEASE... Bruno ...

Andreas Gratz
July 22nd, 1998, 09:01 AM
Hello,


i had much of this problems using an ACCESS ODBC datasource. The problems occured in multithreaded and singlethreaded environment. After some trials i found that if the database and set instances are at global scope, the errors are reduced but not completly suppressed. Looking at the debugger at the point of error leed to the conclusion that this is a special synchronisation problem in shuting down the ODBC workthreads.


If you want, try it

Andreas

Bob Dunlop
August 13th, 1998, 12:54 PM
Andreas,


I don't believe any of the file-based ODBC data sources (Access especially) support threading (if I remember correctly they all use the same DLL for access). The documentation I've read indicates only the more powerful (e.g. SQL Server, Oracle, etc.) relational servers support threading from ODBC.


Bob

//JP added flex table