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. General Programming
  3. C / C++ / MFC
  4. Inserting Data in database by Atl consumer wizard [modified]

Inserting Data in database by Atl consumer wizard [modified]

Scheduled Pinned Locked Moved C / C++ / MFC
helpc++databasetutorial
1 Posts 1 Posters 0 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.
  • W Offline
    W Offline
    With_problem
    wrote on last edited by
    #1

    I am using this code to insert data in msaccess database,but rateher then saving the record it will save in database some otehr values: like: ID DateTimeStamp MarketNo Bid MarketName Ask MarketState -858993459 0:00:00 0 -368934881474191.0324 -368934881474191.0324 -13108 -858993458 0:00:00 1342 -368934881474191.0324 -368934881474191.0324 -13108 -858993457 0:00:00 1342 -368934881474191.0324 -368934881474191.0324 -13108 -858993456 0:00:00 1342 -368934881474191.0324 -368934881474191.0324 -13108 -858993455 0:00:00 1342 -368934881474191.0324 -368934881474191.0324 -13108 How to solve this problem,I have made comment line before the database code by which i am getting this problem. void CArielProjectVer2Dlg::OnPriceChangeArielapictrl1(LPCTSTR SessionId, LPCTSTR RequestId, short MarketNo, LPCTSTR Market, LPCTSTR Bid, short BidDirection, LPCTSTR Ask, short AskDirection, LPCTSTR High, LPCTSTR Low, short MarketState, LPCTSTR Timestamp) { // TODO: Add your control notification handler code here SessID=SessionId; CurrentRequestId=RequestId; CString MarketSt,a,b,c,d; txtMarket = Market; a.Format("%d",MarketNo); b.Format("%c",BidDirection); c.Format("%c",AskDirection); d.Format("%d",MarketState); m_MainEdit=m_MainEdit + "" +" " + SessionId + "\t" + RequestId +"\t"+ a ; m_MainEdit=m_MainEdit + "\t"+ Market + "\t " + Bid + "\t " + b + " \t"+ Ask + "\t" +c +"\t "+ High + "\t"; m_MainEdit=m_MainEdit + Low + "\t" + d + " "+ "\t" + Timestamp + "\r\n"; UpdateData(FALSE); iLineCount=m_EditCtrl.GetLineCount(); m_EditCtrl.LineScroll(iLineCount); //:confused: CODE FOR INSERT DATA IN DATABASE:confused: // m_TQuote is object of table T_Quote (CTQuote m_TQuote) m_TQuote.MoveLast(); int nCount = m_TQuote.m_ID; nCount++; m_TQuote.m_ID = nCount; HRESULT hResult = m_TQuote.Insert(); //specify the insert accessor if(FAILED(hResult)) { AfxMessageBox(_T("Error inserting the record")); return; } -- modified at 22:44 Monday 6th November, 2006

    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