Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
CODE PROJECT For Those Who Code
  • Home
  • Articles
  • FAQ
Community
  1. Home
  2. Database & SysAdmin
  3. Database
  4. a problem about stackoverflow

a problem about stackoverflow

Scheduled Pinned Locked Moved Database
helpquestiondatabase
4 Posts 2 Posters 1 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • N Offline
    N Offline
    nibabug
    wrote on last edited by
    #1

    void CSerialRecieveDlg::OnBtnAutosend() { // TODO: Add your control notification handler code here if(!m_ctrlMSCommCOM1.GetPortOpen()) AfxMessageBox("please open the port!"); else { CCreateName Dlg; CString TB_Name; CString mstr; if(Dlg.DoModal()==IDOK) { TB_Name=Dlg.m_TableName; } m_pRecordset->Close(); //// create a new table in SQL mstr.Format("IF NOT EXISTS (SELECT * FROM sysobjects WHERE name = '"); mstr+=TB_Name; mstr+="') CREATE TABLE "; mstr+=TB_Name; mstr+=" (ID INT,FangWei TEXT,FuYang TEXT,QingXie TEXT)"; try { m_pRecordset->Open(mstr.AllocSysString theApp.m_pConnection.GetInterfacePtr(), adOpenDynamic, adLockOptimistic, adCmdText); } catch(_com_error *e) { AfxMessageBox(e->ErrorMessage()); } SetTimer(1,500,NULL); } } when dibug to the end, appear an ERROR about "stackoverflow" what is the problem??

    wuhuaiji

    P 1 Reply Last reply
    0
    • N nibabug

      void CSerialRecieveDlg::OnBtnAutosend() { // TODO: Add your control notification handler code here if(!m_ctrlMSCommCOM1.GetPortOpen()) AfxMessageBox("please open the port!"); else { CCreateName Dlg; CString TB_Name; CString mstr; if(Dlg.DoModal()==IDOK) { TB_Name=Dlg.m_TableName; } m_pRecordset->Close(); //// create a new table in SQL mstr.Format("IF NOT EXISTS (SELECT * FROM sysobjects WHERE name = '"); mstr+=TB_Name; mstr+="') CREATE TABLE "; mstr+=TB_Name; mstr+=" (ID INT,FangWei TEXT,FuYang TEXT,QingXie TEXT)"; try { m_pRecordset->Open(mstr.AllocSysString theApp.m_pConnection.GetInterfacePtr(), adOpenDynamic, adLockOptimistic, adCmdText); } catch(_com_error *e) { AfxMessageBox(e->ErrorMessage()); } SetTimer(1,500,NULL); } } when dibug to the end, appear an ERROR about "stackoverflow" what is the problem??

      wuhuaiji

      P Offline
      P Offline
      Pete OHanlon
      wrote on last edited by
      #2

      The problem would appear to be that you've posted a C++ question in the SQL forum. Please choose a more appropriate one. Just because you've used the word Recordset in the post doesn't actually make this a database issue. It's still C++.

      Deja View - the feeling that you've seen this post before.

      N 2 Replies Last reply
      0
      • P Pete OHanlon

        The problem would appear to be that you've posted a C++ question in the SQL forum. Please choose a more appropriate one. Just because you've used the word Recordset in the post doesn't actually make this a database issue. It's still C++.

        Deja View - the feeling that you've seen this post before.

        N Offline
        N Offline
        nibabug
        wrote on last edited by
        #3

        thanks a lot:)

        wuhuaiji

        1 Reply Last reply
        0
        • P Pete OHanlon

          The problem would appear to be that you've posted a C++ question in the SQL forum. Please choose a more appropriate one. Just because you've used the word Recordset in the post doesn't actually make this a database issue. It's still C++.

          Deja View - the feeling that you've seen this post before.

          N Offline
          N Offline
          nibabug
          wrote on last edited by
          #4

          excuse me but i have found that when i do nothing to the database in a WM_TIMER function, there is no error, but just if i do something, for example: void CSerialRecieveDlg::OnTimer(UINT nIDEvent){ CString str; CCreateName Dlg; CString TB_Name; TB_Name=Dlg.m_TableName; str.Format("SELECT * FROM "); str+=TB_Name; try { //先关闭已经打开的记录集对象 m_pRecordset->Close(); //根据新的Sql查询语句,重新打开记录集对象 m_pRecordset->Open(str.AllocSysString(), theApp.m_pConnection.GetInterfacePtr(), adOpenDynamic, adLockOptimistic, adCmdText); } catch(_com_error *e) { AfxMessageBox(e->ErrorMessage()); } m_pRecordset->MoveNext(); CDialog::OnTimer(nIDEvent); } there is a runtime error, The problem is that i do not know it is a database problem or a C++ problem??

          wuhuaiji

          1 Reply Last reply
          0
          Reply
          • Reply as topic
          Log in to reply
          • Oldest to Newest
          • Newest to Oldest
          • Most Votes


          • Login

          • Don't have an account? Register

          • Login or register to search.
          • First post
            Last post
          0
          • Categories
          • Recent
          • Tags
          • Popular
          • World
          • Users
          • Groups