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
  1. Home
  2. General Programming
  3. C / C++ / MFC
  4. display a value in an EDITBOX

display a value in an EDITBOX

Scheduled Pinned Locked Moved C / C++ / MFC
databasequestion
4 Posts 2 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.
  • G Offline
    G Offline
    Gerald Mercet
    wrote on last edited by
    #1

    I'm using ADO to do a connection with Access database. I have a dlgbox with editbox which are linked to this app. When i do the loop:while(!pRs->EndOfFile) { if(m_dlglDate==rs.m_ch_RateDate) {....} I would like to return value in an editbox when my test "if" succeeded, so how could i do that? thanks in advance gerald :confused: X| :confused:

    G 1 Reply Last reply
    0
    • G Gerald Mercet

      I'm using ADO to do a connection with Access database. I have a dlgbox with editbox which are linked to this app. When i do the loop:while(!pRs->EndOfFile) { if(m_dlglDate==rs.m_ch_RateDate) {....} I would like to return value in an editbox when my test "if" succeeded, so how could i do that? thanks in advance gerald :confused: X| :confused:

      G Offline
      G Offline
      Gerry
      wrote on last edited by
      #2

      Do you mean, just pass a value into the editbox field? if so,I just use DDX & m_EditControl.SetWindowText("VALUE"); or SetDlgItemText(IDC_EDIT1,"VALUE"); Gerry.

      G 1 Reply Last reply
      0
      • G Gerry

        Do you mean, just pass a value into the editbox field? if so,I just use DDX & m_EditControl.SetWindowText("VALUE"); or SetDlgItemText(IDC_EDIT1,"VALUE"); Gerry.

        G Offline
        G Offline
        Gerald Mercet
        wrote on last edited by
        #3

        yes, exactly, if i could find the value in the database i want to return it in the editbox, but it could be a COleDateTime or a double, so i believe that setwindowtext return string. How could i return a double value or a COleDateTime value in editbox?

        G 1 Reply Last reply
        0
        • G Gerald Mercet

          yes, exactly, if i could find the value in the database i want to return it in the editbox, but it could be a COleDateTime or a double, so i believe that setwindowtext return string. How could i return a double value or a COleDateTime value in editbox?

          G Offline
          G Offline
          Gerry
          wrote on last edited by
          #4

          There are plenty of ways to convert a double to a string. Function _ecvt for one. double to string pointer. As for COleDateTime, COleDateTime x(1999, 3, 19, 22, 15, 0); CString str = x.Format(_T("%A, %B %d, %Y")); m_EditBox.SetWindowText(str); Hope this helps.... Gerry.

          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