I have a question with repeat open and close table

hello,everybody:

  I write one thread with use Vc6 IDE and I need repeat read data from table
,

  but it had throw error message when my application is runing.

  Error message is:

    This application has requested the Runtime to terminate it in an unusual
way.
    please contact the application's support team for mor information��

  My segment of code fellow:

/*
  return false if empty data
*/
bool CReadData::OpenTable()
{
   ASSERT(m_pConn != NULL);           //ado connection
   ASSERT(m_pTable_SMO != NULL);      // table
 try
 {
     if (m_pTable_SMO->GetState() & adStateOpen)
       m_pTable_SMO->Close();                       //close my table

    m_pTable_SMO->Open("select * from t_sminorder",  //open my table
        m_pConn.GetInterfacePtr(),
        adOpenDynamic,
        adLockOptimistic,
        adCmdText);

  bool Empty = (bool)m_pTable_SMO->ADOEOF;
  if (!Empty)
     m_pTable_SMO->MoveFirst();
   return !Empty;
 }
 catch(_com_error *e)
 {
     return false��
  }
}


I need repeat read data from table in my thread code,

/*
  it process repeat data in my thread
*/
 DWORD WINAPI CReadData::Read_MO(void* lpParam)
{
 ...
 while(1)
 {

   if( pRd->OpenTable() == false)         //read data from table
     continue;
   ....
   ....
  }
}

It wouldn't any exception when I add one sentence with Sleep(1000) ,
Why don't rapid read data?

I write other code in CBuilder,write simple code with repeat open and close
table, fellow

fastcall void TForm1::Button1Click(TSender : Sender)
{
   while(1)
   {
     adoTable1.close();
     adoTable1.open();
   }
}
  it is good for rapid read data from table, it explain the ADO support to
rapid  open and close operate,
 but why don't rapid close and open in VC6?

 Please master-hand give me directions....



0
6/8/2006 11:56:57 AM
vc.mfc 33608 articles. 0 followers. Follow

0 Replies
395 Views

Similar Articles

[PageSpeed] 39

Reply:

Similar Artilces:

Backup question
I've moved to a new pc and for some reason I thought that when you backed up, a new file was created. Am I right? At the moment, it's just backing up to the backup file. So I've just just my working file and my backup file. Please could you clarify this? Thanks again. In microsoft.public.money, abc wrote: >I've moved to a new pc and for some reason I thought that when you >backed up, a new file was created. Am I right? At the moment, it's >just backing up to the backup file. So I've just just my working file >and my backup file. P...

Question about Xml Schemas "qualified" and "unqualified"
In the textbook, there is a sentence that "Default XML namespaces(xmlns="...") helps a lot, but can also create problems, as a side effect of the rules for automatic qualification. How to understand "automatic qualification" here? Could you please give me an example? Secondly, unless otherwise specified, a schema prescribes that loal elements and attributes must be "unqualified". What does "unqualified" mean? Could you please giv eme an example? Finnaly, could you please tell me what's purpose of using these two things? Thanks a lot! ...

a question and a question
What is the correct name of the type of selection box used in "customizing Word", for example.... you select a word or operation from a list on the left pane and move it over to the right pane. Is there a template to build one of these? thanx You will have to explain more in detail what you are trying to do. -- Stefan Blom Microsoft Word MVP "cliffordjf" <cliffordjf@discussions.microsoft.com> wrote in message news:9856CCA7-8A8E-440C-A0D4-76EE4FA644E2@microsoft.com... > What is the correct name of the type of selection box used in "c...

IE8 privacy question
I am running XP-Pro SP3 and considering upgrading from IE7 to IE8. I have read all the feature and benefit articles from MS, but have one question that remains unanswered. In IE8 there is mention of being able to restore previously viewed websites or something to that effect. I think this is on a drop down menu somewhere. 1) Does In-private viewing prevent this? 2) Does manually deleting your complete browsing history clear this? 3) Is there a registry entry that can prevent this action? 4) Is there a group policy change that can prevent this action? In essence for privacy pur...

IF AND question
Hi there, I need a function that can provide one of three answers: 1 2 1 1... 3 3 4 4... ? ? ? ?... If A1 = 1 and A2=3, answer 106; but if A1=1 and A2 = 4, answer 104; but if A1=2, regardless of A2, answer 95. The next function for column B is the same, except the answer is dependent on the value delivered from the column A function. E.g. A3 + 6 or A3 +4 or A3-5 etc. Any help would be most appreciated. -- ***** Many thanks Gamq Use the below formula for your first query. =IF(A1="","",IF(A1=2,95,IF(AND(A1=1,A2=3),106,IF(AND(A1=1,A2=4),104)))) ...

Question about Paste Special
Hi, I have a problem sometimes with the paste special options when goin from one excel workbook to another. For example, sometimes when I cop data from one workbook and then paste special into another, I get th options that include: All, formulas, values, formats, has the option t transpose the data and paste link among other options. And the sometimes I try and paste data to another workbook and I end up th paste special options: Bitmap Image Object, picture, bitmap, and I als lose the ability to paste link. Well you can do it, but it puts it i as an object. What I want is the first past...

loss of accuracy in pivot table
Hi Fellow Excel puzzlers I create a pivot table and extract time data which has been custo formatted to show minutes seconds and two decimal places of second (i.e. down to hundreths) however the pivot table has then lost th tenths and hundredths of a second and shows all times with the tenth and hundreths as ".00" why is this happening is it a hidden rounding can it not handle time to this accuracy when translating data into pivot table any thoughts or knowledge on the subject appreciated -- the swimme ----------------------------------------------------------------------- the sw...

Outlook 2003: Will Not Open
Out of no-where: Today Outlook decided to not open. Here is the error message: "Can not start microsoft outlook. Unable to open outlook window. The set of folders cold not be opened. The server is not available. Contact your administrator if this condition persists". There is no problem with the server, I checked. I have no "Administrator" My kid is only 11 so it will be another year or 2 before he earns that title. What now? Any suggestions would be appreciated. (For the rest of my life, anytime I encounter any problem with another person I am going to tell them to...

Question
Why did the chicken cross the road? -- Dr. Stephen Hopkins, MD "Dr. Stephen Hopkins, MD" <DrStephenHopkinsMD@discussions.microsoft.com> wrote in message news:B8434E21-DDA3-44D7-B39B-CD5A8C33A7BD@microsoft.com... > Why did the chicken cross the road? > -- > Dr. Stephen Hopkins, MD To collect her email, why else? Dr? You should be ashamed to put such a title on an idiotic off topic post !! -- Regards Steve. MS-MVP. MAIL. [DTS] UK. http://www.getsafeonline.org/ mac;1266180 Wrote: > "Dr. Stephen Hopkins, MD" <DrSte...

How to clear the Open Recent Database pane on Getting Started scre
In Access 2007, on the "Getting Started with Microsoft Office" page, I want to clear all of the file names under "Open Recent Database" on the right. Deleting the actual files from my computer doesn't remove the names from that pane. Why does it matter? I never tried this in 2007 but changing how many to display on older versions cleared list. Click on the Office button, Access Options, Advanced, Display, and set to 0 (zero). Close application. Restart and check. -- Build a little, test a little. "Judith9" wrote: > In Access 20...

Microsoft Query question
I am trying to use Microsoft Query to get data from my SQL 2000 databases. The problem is that I have a few columns with names that conflict with keywords (like Identity). (Yes. I kow that keywords should be avoided but it is done and cannot be changed.) This is causing a keyword syntax error within the Query application. Oddly enough, even if I do not select the column the error still appears. And when you look at all the columns available, the keyword named column shows up in boldface. When I am doing queries in other programs I put square ("[ ]") brackets around column and table...

OWA Question #16
Hello All: Quick Question regarding OWA. We are about to finalize migration from 5.5 to 2003. We have an existing web presence already in DNS a www.mydomain.com. and running on existing web servers. With 5.5 natrually, to access OWA, it was www.mydomain.com/exchange. This will not be possible now since OWA runs off of the Exchange server instead of relying on our web server under 5.5. What's the easiest way to overcome this. Thanks If you can afford the extra license, you'll probably want to run a front-end server so no one is connecting directly to the Exchange database s...

Text Box Question
Greetings, I have been using Visio for years, however, something has happened and I can't figure out how to undo it. Basically up until today when I added a text box and entered text, the text went horizontal as it was typed. Today when I add a text box and enter text, the text goes vertical. How do I get back to the old behavior? TIA using text container shape adjusting tool (text block tool), make the text container shape wider horizontally. Have you used Asian text font recently?...check help for "vertical text" "Ray Batig" wrote: > Greetings, > &g...

Open CSV file by double-click on explorer all data in one column
Hi, I have a Windows NT with Excel 97. I have a very simple csv file containing: 1;2;3 When I open this test.csv file from File->Open in Excel it renders the data in three different columns. If I open the file by double-clicking in explorer it launches Excel and the data if confined in the first column. It seems as if it doesn't do the same when opening in both ways. Any hint? What do you have for your windows list separator? Close excel windows start button|settings|control panel|Regional and language options Click the customize button Numbers Tab List separator Make sure it ma...

VBA//Oracle Interfacing Question
All, I have been able to correct to my database but I have one question question: Within objSession I want to list all available tables and all available views. How exactly is this done? thank you. Set objSession = CreateObject("OracleInProcServer.XOraSession") Set objDatabase = objSession.OpenDatabase("", "User/Pass", 0) On Nov 16, 12:05=A0pm, jason <jason.mell...@gmail.com> wrote: > All, > > I have been able to correct to my database but I have one question > question: > > Within objSession I want to list all avail...

GP 7.5v Year End Close
Does anyone know where I can find information on the steps need to close out the year for GP 7.5v. Thanks Customersource knowledgebase has year end closing checklists. "Allyson" wrote: > Does anyone know where I can find information on the steps need to close out > the year for GP 7.5v. Thanks ...

401K questions
I just started a 401K at work and I'm wondering how to deal with it in Money. I've got my paycheck split into different categories currently and now I have to put the 401K amount into a category as well. I didn't see one specifically for this. What do other people use? Should I start using the 401K Manager? I haven't gone through it yet I'm just wondering if it works well and how much benefit I'll get from it. Thanks in advance! Mike You will want to create an investment account for the 401(k) and TRANSFER your contributions from your checking account to the...

If / Then Question
How would I do this: IF A1="N" then I need A2 and A3 to="N/A -- pkniven ----------------------------------------------------------------------- pknivens's Profile: http://www.excelforum.com/member.php?action=getinfo&userid=2767 View this thread: http://www.excelforum.com/showthread.php?threadid=47531 pknivens Wrote: > How would I do this: > > IF A1="N" then I need A2 and A3 to="N/A" Hi pknivens In A2 and A3 use this formula > =IF(A1="N","N/A",""), this will return blank if A1 is not N, if you want it...

ROWCOUNT question
Hi All, The below is a UDF that returns the ROWCOUNT for a table. I need to know that value for WHILE loop. How do I take the Returned value from the UDF and load it intio a variable in the SP where it was called from? Or maybe there is another way. ALTER FUNCTION [dbo].[RecCount] ( @TableName CHAR(15) ) RETURNS TABLE AS RETURN ( SELECT Rows FROM sysindexes WHERE id = OBJECT_ID(@TableName) AND indid < 2 ) Thanks, Eric Eric S (xxx_noSpam@Hotmail.com) writes: > The below is a UDF that returns the ROWCOUNT for a table. I need to know > that va...

Collapse all open documents to a single toolbar button
On my desktop computer, multiple documents appear on a single button in the toolbar but on my laptop they appear as separate buttons. How do I get all open documents to collapse to a single toolbar button? I did this once but forget how. =46WIW I'm using Word 2002 on both machines. --=20 Bob http://www.kanyak.com ...

Pivot Table formatting #2
I have a pivot table where I can left click on the fields such as Customer or Sum of Quantity and it highlights all of the cells in that fields row or column in a reverse video and then I can format that data and everything is great. I am working with someone over the phone that when they click on the field, it does not highlight the associated data cells and therefore they can not format the data and save those formats for when they change the pivot table. Any ideas why this might be? We are both using Excel 97. Thanks, Steve To turn on the Enable Selection feature: From the Pivot to...

Exmerge Question #7
When I run Exmerge on a mailbox on my 2003 server to export to a PST, it will delete all emails after the copy. I thought EXmerge would "copy" not delete. is this the default? If so how can I just have it do a copy out to the PST and leave the mailbox alone. thanks Rick in "options", make sure "archive data to target store" is not selected on the "Import procedure" tab... -- Susan Conkey [MVP] "Rick" <drummer10980@gmail.com> wrote in message news:1165509540.777142.38260@16g2000cwy.googlegroups.com... > When I run Exmerge on ...

Counting Table (By Date)
Is there a way to make an table/query in Access that counts by date? For example, if I have multiple projects with different start dates, I'd like to have a running count of the months for the project... e.g. Start Date 02/28/2010 03/1/2010 05/31/2010 Project A B C Date 1/2010 0 0 0 2/2010 1 0 0 3/2010 2 1 0 4/2010 3 2 0 ...

How do I keep excel chart "data table" formats in several workbook
I have 1 workbook with the source data that creates serveral charts. The charts have been formated to show "data tables" containing both dollars and percents. I want to take the graphs and split up to various excel workbooks. When I copy the graph tab from the source file into the new workbook, I lose the formatting on the "data tables." Is there a way to copy the graphs to new workbooks while retaining the "data table" formats? I would prefer to not have to maintain the source data within each of the workbooks. The goal is to update the source file wh...

question about "delete"
I have a pointer: MyWindowClass *p = NULL; p = new MyClass(...); .... delete p; After delete p, does p equal NULL(it is in C++ standard?)? How to decide if p has been deleted? The reason I asked this question is that in my project, there are many code/files use the pointer which I need to determine is it is deleted? Can I use: if(p != NULL) delete p; I guess somewhere p has been deleted, but p still not NULL(possible?), the above code might cause problem. Hi Kathy, I typically just set p to NULL when I delete it: delete p; p = NULL; Then you can check it in other places and ...