Welcome to dbFreaks.com!
FAQFAQ    SearchSearch      ProfileProfile    Private MessagesPrivate Messages   Log inLog in

Trouble with Multi-Threading (VC++ opening Access via ODBC)

 
   Database Help (Home) -> Visual Basic -> ODBC RSS
Next:  [Microsoft][ODBC dBase driver]External Table is n..  
Author Message
zmau

External


Since: Jul 03, 2005
Posts: 1



(Msg. 1) Posted: Sun Jul 03, 2005 12:36 pm
Post subject: Trouble with Multi-Threading (VC++ opening Access via ODBC)
Archived from groups: microsoft>public>vb>database>odbc (more info?)

Hi all,


I have an application which I did not write, but I want to improve it's
performance (Obviously I do have the code).


First of all I am not a database expert so my terms may not be exact, I
appologize Smile)


The application starts by reading a lot of data from the database tree
via ODBC (MFC + VC++ 6.0).
This process takes a few minuets, and I have more than one CPU, so
obviously I was thinking of multi-threading.
The point is that once I Multi-threaded the code, the program stuck
during startup. Looking with a debugger, I saw that all threads are
hanging while reading the DataBase. A code example is attached at the
end.


The problem persists even if I open the program twice (with the
original code !!), so it looks to me that the Databae/ODBC can not be
opened twice.
I thing that the problem is that I need to open the DataBase with
multiple read permision. How do I do that ?


More details regarding how do we load the data :
We read one table, the data of this table (Actually it's one of the
columns ) leads to read more tables, which leads to read more tables.
The whole code looks like million loops of the following example :
char achFilter[100];
CBlockSpecSet blockSpecSet(m_pDoc->m_pDB);


sprintf(achFilter,"lBlockID=%d­", m_lId);
blockSpecSet.m_strFilter = (CString)achFilter;


TRY
{
if (blockSpecSet.Open())
{
while (!blockSpecSet.IsEOF())
{
m_SpecificsArray.Add((CSpecifi­c*) new
CSpecific(
blockSpecSet.m_strFieldName,

blockSpecSet.m_strFieldDescrip­tion,
blockSpecSet.m_dValue));


m_nNumOfSpecifics++;


blockSpecSet.MoveNext();
} // while
} // if blockSpecSet.Open()
} // TRY
CATCH(CDBException, e)
{
AfxMessageBox(e->m_strError);
}
END_CATCH
blockSpecSet.Close();


Last thing is the following definition:
CDatabase* m_pDB; // Pointer to the Simulator
database. (File_DB.mdb)


Thanks
Maurice

 >> Stay informed about: Trouble with Multi-Threading (VC++ opening Access via ODBC) 
Back to top
Login to vote
Display posts from previous:   
Related Topics:
ODBC Access reference material - Hi there, I was wondering if there was some kind of online reference as the the syntax used for a Microsoft ODBC Access driver's SQL statements. I'm converting a web site over to another server and I'm having syntax issues as I've just switched....

The whole ODBC idea - To date my database stuff is with access databases, and I have no real appreciation with using ODBC. My VB6 application: Developing code to be run on a Win2000 machine that needs to read/write certain records in a Foxpro database. However the ..

LDAP query from ODBC? - I'm trying to build a query to pull some information from my LDAP based on a user ID. Dim conLDAP As ADODB.Connection Dim strSQL As String Dim strLDAPConn As String Dim rsUser As ADODB.Recordset Set conLDAP = New ADODB.Connection ...

ODBC CONNECTION FROM COMMAND LINE - I am trying to get an ODBC connection created from a commandline, I have created the ODBC connection, exported the registry key, and have tried doing regedit /s "regkey", problem is after I do that it never shows us in the ODBC manager, it sh...

Automate ODBC DSN Setup - I have been thinking of using VBscript to automate the set up of the ODBC DSN entries. There are some discussions on the Internet that I can find. Unfortunately, none of them gives me any hints on how I can store the username (such as sa) and passwor...
   Database Help (Home) -> Visual Basic -> ODBC All times are: Pacific Time (US & Canada)
Page 1 of 1

 
You can post new topics in this forum
You can reply to topics in this forum
You can edit your posts in this forum
You can delete your posts in this forum
You can vote in polls in this forum



[ Contact us | Terms of Service/Privacy Policy ]