• Visitors can check out the Forum FAQ by clicking this link. You have to register before you can post: click the REGISTER link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below. View our Forum Privacy Policy.
  • Want to receive the latest contracting news and advice straight to your inbox? Sign up to the ContractorUK newsletter here. Every sign up will also be entered into a draw to WIN £100 Amazon vouchers!

Find & Replace in VB6

Collapse
X
  •  
  • Filter
  • Time
  • Show
Clear All
new posts

    Find & Replace in VB6

    I wrote an app which keeps records on Mrs. wc2's snakes.

    She like the New Liar government wants to change the spec

    It's hard coded to look for the database in c:\program files\my app\database.

    Is there a way of executing a global find/replace?

    I want the code to read f:\my app\database.

    Ta
    Throw them to the lions - WC2 5.4

    #2
    In the IDE select Edit/Replace & Current Project

    Comment


      #3
      I'll get my coat

      Thanks
      Throw them to the lions - WC2 5.4

      Comment


        #4
        Originally posted by wc2 View Post
        I wrote an app which keeps records on Mrs. wc2's snakes.

        She like the New Liar government wants to change the spec

        It's hard coded to look for the database in c:\program files\my app\database.

        Is there a way of executing a global find/replace?

        I want the code to read f:\my app\database.

        Ta
        Have you thought of moving to India? They are always looking for clever developers over there....

        Comment


          #5
          Maybe while you're at it. why not have it read the database path from a config file. Those old .ini files come in handy sometimes. And I think VB6 can read them quite easily.
          McCoy: "Medical men are trained in logic."
          Spock: "Trained? Judging from you, I would have guessed it was trial and error."

          Comment


            #6
            Originally posted by lilelvis2000 View Post
            Maybe while you're at it. why not have it read the database path from a config file. Those old .ini files come in handy sometimes. And I think VB6 can read them quite easily.
            Or gosh, even the REGISTRY.

            You've come right out the other side of the forest of irony and ended up in the desert of wrong.

            Comment


              #7
              You're all making this far too complex.

              Simply create a batch file that re-maps the drive letters every time she loads the app and another one that re-maps it when she exits it.

              What could possibly go wrong?

              Comment


                #8
                Originally posted by PRC1964 View Post
                You're all making this far too complex.

                Simply create a batch file that re-maps the drive letters every time she loads the app and another one that re-maps it when she exits it.

                What could possibly go wrong?
                Your assuming that the missus hasn't mistakenly re-mapped the drive letter already. In which case...

                What about if the driver letters are mapped on a random basis, and then each drive can be scanned to see if the required database location is present. If found, then the new location for the database can then be mapped.

                Problem solved!!!!!!

                Comment


                  #9
                  Look I used to hump servers for a living until I got caught and had to do some real work.

                  I'll read up on the config file.

                  Thanks
                  Throw them to the lions - WC2 5.4

                  Comment


                    #10
                    Originally posted by bogeyman View Post
                    Or gosh, even the REGISTRY.
                    Even Microsoft have realised how absurd a central storage of configuraion settings is. Especially when it can't be backed up or restored. The new fashion is the old fashion to use local config files! This is what server 2008 is doing with its new components (xml config files). There will probably be a Microsoft patent on this amazing concept soon despite being industry standard for *nix.

                    Use the API SHGetSpecialFolderLocation with enum CSIDL_APPDATA to get 'C:\Documents and Settings\username\Application Data' or equivilent and store your configuration there.

                    Comment

                    Working...
                    X