Alpha Software Mobile Development Tools:   Alpha Anywhere    |   Alpha TransForm subscribe to our YouTube Channel  Follow Us on LinkedIn  Follow Us on Twitter  Follow Us on Facebook

Announcement

Collapse

The Alpha Software Forum Participation Guidelines

The Alpha Software Forum is a free forum created for Alpha Software Developer Community to ask for help, exchange ideas, and share solutions. Alpha Software strives to create an environment where all members of the community can feel safe to participate. In order to ensure the Alpha Software Forum is a place where all feel welcome, forum participants are expected to behave as follows:
  • Be professional in your conduct
  • Be kind to others
  • Be constructive when giving feedback
  • Be open to new ideas and suggestions
  • Stay on topic


Be sure all comments and threads you post are respectful. Posts that contain any of the following content will be considered a violation of your agreement as a member of the Alpha Software Forum Community and will be moderated:
  • Spam.
  • Vulgar language.
  • Quotes from private conversations without permission, including pricing and other sales related discussions.
  • Personal attacks, insults, or subtle put-downs.
  • Harassment, bullying, threatening, mocking, shaming, or deriding anyone.
  • Sexist, racist, homophobic, transphobic, ableist, or otherwise discriminatory jokes and language.
  • Sexually explicit or violent material, links, or language.
  • Pirated, hacked, or copyright-infringing material.
  • Encouraging of others to engage in the above behaviors.


If a thread or post is found to contain any of the content outlined above, a moderator may choose to take one of the following actions:
  • Remove the Post or Thread - the content is removed from the forum.
  • Place the User in Moderation - all posts and new threads must be approved by a moderator before they are posted.
  • Temporarily Ban the User - user is banned from forum for a period of time.
  • Permanently Ban the User - user is permanently banned from the forum.


Moderators may also rename posts and threads if they are too generic or do not property reflect the content.

Moderators may move threads if they have been posted in the incorrect forum.

Threads/Posts questioning specific moderator decisions or actions (such as "why was a user banned?") are not allowed and will be removed.

The owners of Alpha Software Corporation (Forum Owner) reserve the right to remove, edit, move, or close any thread for any reason; or ban any forum member without notice, reason, or explanation.

Community members are encouraged to click the "Report Post" icon in the lower left of a given post if they feel the post is in violation of the rules. This will alert the Moderators to take a look.

Alpha Software Corporation may amend the guidelines from time to time and may also vary the procedures it sets out where appropriate in a particular case. Your agreement to comply with the guidelines will be deemed agreement to any changes to it.



Bonus TIPS for Successful Posting

Try a Search First
It is highly recommended that a Search be done on your topic before posting, as many questions have been answered in prior posts. As with any search engine, the shorter the search term, the more "hits" will be returned, but the more specific the search term is, the greater the relevance of those "hits". Searching for "table" might well return every message on the board while "tablesum" would greatly restrict the number of messages returned.

When you do post
First, make sure you are posting your question in the correct forum. For example, if you post an issue regarding Desktop applications on the Mobile & Browser Applications board , not only will your question not be seen by the appropriate audience, it may also be removed or relocated.

The more detail you provide about your problem or question, the more likely someone is to understand your request and be able to help. A sample database with a minimum of records (and its support files, zipped together) will make it much easier to diagnose issues with your application. Screen shots of error messages are especially helpful.

When explaining how to reproduce your problem, please be as detailed as possible. Describe every step, click-by-click and keypress-by-keypress. Otherwise when others try to duplicate your problem, they may do something slightly different and end up with different results.

A note about attachments
You may only attach one file to each message. Attachment file size is limited to 2MB. If you need to include several files, you may do so by zipping them into a single archive.

If you forgot to attach your files to your post, please do NOT create a new thread. Instead, reply to your original message and attach the file there.

When attaching screen shots, it is best to attach an image file (.BMP, .JPG, .GIF, .PNG, etc.) or a zip file of several images, as opposed to a Word document containing the screen shots. Because Word documents are prone to viruses, many message board users will not open your Word file, therefore limiting their ability to help you.

Similarly, if you are uploading a zipped archive, you should simply create a .ZIP file and not a self-extracting .EXE as many users will not run your EXE file.
See more
See less

Rename Database function

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

    Rename Database function

    Here is an xdialog that renames a db. Of course, you need to be in another db than the one you wish to rename in order to use it.

    Function download for easy A5 import below. Code here:
    Code:
    'Date Created: 18-Feb-2008 03:53:51 PM
    'Last Updated: 20-Nov-2008 10:38:43 AM
    'Created By  : PG
    'Updated By  : PG
    FUNCTION f_db_rename AS L (vSource="" AS C, vTarget="" AS C )
    'Rename a database
    
    DIM SHARED vSource as c
    DIM SHARED vTarget as C
    DIM SHARED xBox as C
    ok_button_label = "&OK"
    cancel_button_label = "&Cancel"
    xBox = ui_dlg_box("Rename Database",<<%dlg%
    {region}
    Select the existing database:| [%p=ui_get_file("Select a database","Database (*.adb)",vSource,"X");I=$a5_smart_file%.50vSource];
    Type new name here \(w/o path or ext):| [.50vTarget];
    {endregion};
    {line=1,0};
    {region}
    <*15=ok_button_label!OK> <15=cancel_button_label!CANCEL>
    {endregion};
    %dlg%)
    
    IF xBox = "OK"
        vPath = FILE.FILENAME_PARSE(vSource,"P")
        vName = FILE.FILENAME_PARSE(vSource,"N")
        FILE.RENAME(vSource,vPath + chr(92) + vTarget + ".adb")
        FILE.RENAME(vPath + chr(92) + vName + ".alb",vPath + chr(92) + vTarget + ".alb")
        FILE.RENAME(vPath + chr(92) + vName + ".alm",vPath + chr(92) + vTarget + ".alm")
        FILE.RENAME(vPath + chr(92) + vName + ".alx",vPath + chr(92) + vTarget + ".alx")
        
    xMsg =<<%text%
    Check to see if there are any libraries associated with the old database name.
    
    1. Select File > Database Properties.
    2. Display the Libraries tab.
    3. Select each library associated with the old database name and click Remove.
    
    %text%
    
        ok_button_label = "&OK"
        x = ui_dlg_box("Database Renamed",<<%dlg%
        {region}
        |{text=90,6:xMsg};
        {endregion};
        {line=1,0};
        {region}
        <*15=ok_button_label!OK>
        {endregion};
        %dlg%)
    
        f_db_rename = .T.
    ELSE
        f_db_rename = .F.
    END IF
    END FUNCTION
    Peter
    AlphaBase Solutions, LLC

    [email protected]
    https://www.alphabasesolutions.com



    #2
    Re: Rename Database function

    Peter,
    I haven't yet tried your function but am wondering if this would rename a database that is not open BUT is on the Alpha list of recent databases?

    ...I seem to remember trying to do similar manually and was prevented if Alpha was open and the particular database was on the list.
    Mike
    __________________________________________
    It is only when we forget all our learning that we begin to know.
    It's not what you look at that matters, it's what you see.
    Henry David Thoreau
    __________________________________________



    Comment


      #3
      Re: Rename Database function

      Originally posted by MikeC View Post
      Peter,
      ...but am wondering if this would rename a database that is not open BUT is on the Alpha list of recent databases?
      Just tried it. No problemo.
      Peter
      AlphaBase Solutions, LLC

      [email protected]
      https://www.alphabasesolutions.com


      Comment


        #4
        Re: Rename Database function

        Peter and All, Happy Holidays !!

        For some reason when I go to run the script to rename a DB from another directory while in another, I get no prompts. I placed it into the Interactive editor and it compiles, but when I run it nothing happens. I wonder what dumb things I'm doing..Thanks Rtland

        Comment


          #5
          Re: Rename Database function

          Originally posted by [email protected] View Post
          For some reason when I go to run the script to rename a DB from another directory while in another, I get no prompts. I placed it into the Interactive editor and it compiles, but when I run it nothing happens. I wonder what dumb things I'm doing..
          Hi Ryland,

          Greetings to you too!

          This is not a script (although you could turn it into one), but a function. Do the following:

          Download the above text file.
          From the controlpanel, go to the code tab.
          From the menu, select Code/Import.
          When the dialog pops up, follow the prompts to import the function from the text file into your database.
          Once imported, you should see the function listed in the CP under the code tab.
          Then go to the I.E. and type in :

          f_db_rename()

          A dialog will pop up & you can navigae to the db that you wish to rename.
          Peter
          AlphaBase Solutions, LLC

          [email protected]
          https://www.alphabasesolutions.com


          Comment


            #6
            Re: Rename Database function

            Thanks Peter, worked like a champ..Cheers !!

            Comment


              #7
              Re: Rename Database function

              Peter, this utility for renaming DB is very good.
              Thanks for sharing it.

              It seems that after renaming, the web files are no longer attached to the new DB. However they are there, Not just attached.

              I just wonder how can I bring back the web files after renaming a DB, without recreating it?
              Last edited by MikeData; 01-02-2010, 03:19 PM.

              Comment


                #8
                Re: Rename Database function

                Hhhmmm...

                Ok. I just tried it. Keep in mind I wasn't thinking web when i built this little diddy.

                Open the renamed db and open the web projects controlpanel.
                If you were using a project name before, create it again in the web CP.
                Go to Window's explorer and you will see a new folder set w. the new name.
                Copy the web components from the old folder to the new.

                That seems to work ok.
                Peter
                AlphaBase Solutions, LLC

                [email protected]
                https://www.alphabasesolutions.com


                Comment


                  #9
                  Re: Rename Database function

                  Right again. Just perfect. Thanks.
                  I follow the instructions and notice the renamed DB had only default....
                  So I create a new project and match/copy the folders and files in the original "default...." folder to the new project folder. I delete the original default.
                  They are all there!!!
                  Thanks again.

                  Comment

                  Working...
                  X