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. Reading from a Text File & Database

Reading from a Text File & Database

Scheduled Pinned Locked Moved C / C++ / MFC
helpdatabasequestion
7 Posts 4 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.
  • U Offline
    U Offline
    ugur_basak
    wrote on last edited by
    #1

    i am reading some text from the selected file, then when i push a button i want to insert some data to database (ADO), but cant do. There is an error occured. i tested : when i dont read data from a file, i can use data functions well. I even close CStdioFile and delete its pointer. Can anybody help?

    D 1 Reply Last reply
    0
    • U ugur_basak

      i am reading some text from the selected file, then when i push a button i want to insert some data to database (ADO), but cant do. There is an error occured. i tested : when i dont read data from a file, i can use data functions well. I even close CStdioFile and delete its pointer. Can anybody help?

      D Offline
      D Offline
      David Crow
      wrote on last edited by
      #2

      ugur_basak wrote: There is an error occured. I give up. What's the error?


      "Ideas are a dime a dozen. People who put them into action are priceless." - Unknown

      PJ ArendsP 1 Reply Last reply
      0
      • D David Crow

        ugur_basak wrote: There is an error occured. I give up. What's the error?


        "Ideas are a dime a dozen. People who put them into action are priceless." - Unknown

        PJ ArendsP Offline
        PJ ArendsP Offline
        PJ Arends
        wrote on last edited by
        #3

        Oh come on David:rolleyes: Use your ESP, or lacking that, take a wild guess. You may just hit upon the correct solution.


        "You're obviously a superstar." - Christian Graus about me - 12 Feb '03 "Obviously ???  You're definitely a superstar!!!" mYkel - 21 Jun '04 Within you lies the power for good - Use it!


        Honoured as one of The Most Helpful Members of 2004

        Within you lies the power for good; Use it!

        U 1 Reply Last reply
        0
        • PJ ArendsP PJ Arends

          Oh come on David:rolleyes: Use your ESP, or lacking that, take a wild guess. You may just hit upon the correct solution.


          "You're obviously a superstar." - Christian Graus about me - 12 Feb '03 "Obviously ???  You're definitely a superstar!!!" mYkel - 21 Jun '04 Within you lies the power for good - Use it!


          Honoured as one of The Most Helpful Members of 2004

          U Offline
          U Offline
          ugur_basak
          wrote on last edited by
          #4

          the error: Runtime Error! Program:..... .exe This application has requested the Runtime to terminate it in an unusual way. Please contact the application's support team for more information. --- the error is about this sentence. pConnectRead->Open(commandString, connectionString, adOpenStatic, adLockReadOnly, adCmdText); can this be helpfull to GUESS the solution.:(

          T 1 Reply Last reply
          0
          • U ugur_basak

            the error: Runtime Error! Program:..... .exe This application has requested the Runtime to terminate it in an unusual way. Please contact the application's support team for more information. --- the error is about this sentence. pConnectRead->Open(commandString, connectionString, adOpenStatic, adLockReadOnly, adCmdText); can this be helpfull to GUESS the solution.:(

            T Offline
            T Offline
            ThatsAlok
            wrote on last edited by
            #5

            ugur_basak wrote: Runtime Error! Program:..... .exe Usually this type of error occur due to IMproper/unreferenced Memory allocation. ugur_basak wrote: pConnectRead->Open(commandString, connectionString, adOpenStatic, adLockReadOnly, adCmdText); have you checked that is pConnectRead hold valid memory or any of it args!

            "Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow

            cheers, Alok Gupta

            U 1 Reply Last reply
            0
            • T ThatsAlok

              ugur_basak wrote: Runtime Error! Program:..... .exe Usually this type of error occur due to IMproper/unreferenced Memory allocation. ugur_basak wrote: pConnectRead->Open(commandString, connectionString, adOpenStatic, adLockReadOnly, adCmdText); have you checked that is pConnectRead hold valid memory or any of it args!

              "Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow

              cheers, Alok Gupta

              U Offline
              U Offline
              ugur_basak
              wrote on last edited by
              #6

              CFileDialog fileDlg(TRUE, NULL, NULL, OFN_HIDEREADONLY | OFN_PATHMUSTEXIST, NULL, this); if(fileDlg.DoModal()==IDOK) { sSelectedFile = fileDlg.GetPathName(); } I guess the problem is about the above code, when i use this dialog window the error happens. But if i use the files path name by editing the editbox there is no error. But still cannot use this dialog

              U 1 Reply Last reply
              0
              • U ugur_basak

                CFileDialog fileDlg(TRUE, NULL, NULL, OFN_HIDEREADONLY | OFN_PATHMUSTEXIST, NULL, this); if(fileDlg.DoModal()==IDOK) { sSelectedFile = fileDlg.GetPathName(); } I guess the problem is about the above code, when i use this dialog window the error happens. But if i use the files path name by editing the editbox there is no error. But still cannot use this dialog

                U Offline
                U Offline
                ugur_basak
                wrote on last edited by
                #7

                At the end i find the solution. its about an ugly problem. When we use CFileDialog without OFN_NOCHANGEDIR, it doesnt release some of the handles, and system crashes... dlg = new CFileDialog(FALSE, NULL, NULL, OFN_HIDEREADONLY | OFN_NOCHANGEDIR); this solves everything...

                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