hi all, i used CWinthread created a worker for monitoring a port. in that thread, i need to connect to database. so, i hope to connect the database at that class and execute sql in the worker thread. but, i can't do so. seems that the worker thread can't access that object. here is the code, pls give me some ideas!!! CDatabase db; class CAN { CWinThread abc; static int workerthread; //static CDatabase db; } i tried both setting the CDatabase as global or static. both are not able to access by workerthread. do you have any idea letting workerthread using out thread's object? thanks, jim