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

Copy tables to new ADB

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

  • Copy tables to new ADB

    I would like to copy about 100 tables from one ADB to a new ADB.

    Is there some xbasic that can handle this, or do you need to add them one by one ?

    My problem is:
    I did initially copied the files from source folder to destination folder, then added the files with the "Add tables to database" function on the toolbar to the new adb, but now all date fields with the calendar control type and default date fields are not working properly on all the forms in the new adb.

    I spent a couple of hours trying to redo some forms, or date field objects, but still not working. I did notice however, that when I switch the bitdefender anti virus off, the calendar object loads slightly faster, but otherwise with take a good 40 seconds to load the calendar object for date picking on the form. It is as if the program freeze for a couple of seconds before displaying the calendar object, and to pick a date is also very slow (on the form)

    When I open the original adb , everything is working fine.

    I would appreciate some tips.
    Many thanks.

  • #2
    Re: Copy tables to new ADB

    Is there some xbasic that can handle this,
    file_add_to_db()

    I would assume you would wrap it like

    lst = filefind.get("c:\directory\*.dbf",FILE_FIND_NORMAL,"PN")
    for each foo in lst
    file_add_to_db(foo.value)
    next
    There can be only one.

    Comment


    • #3
      Re: Copy tables to new ADB

      Couldn't you also copy the database and its files to a new directory and then rename the adb?
      Robin

      Discernment is not needed in things that differ, but in those things that appear to be the same. - Miles Sanford

      Comment


      • #4
        Re: Copy tables to new ADB

        Walter,

        Are you working with native Alpha Five tables?

        If so, your data for a table is stored in the DBF file (and FPT files if there are memo fields in your structure). Your indexes are in the CDX file for each table. However, long fieldnames (longer than 10 chars) and all your rules and layouts are stored in the dictionaries for each table. These are the files that have your table name, but end with DDD, DDM and DDX extensions. As a general rule of thumb, when copying a native table to another ADB you should always copy the DBF, FPT, CDX, DDD, DDX and DDM files for each table.

        If you are curious where other parts of your application are stored check the "Alpha File Types" topic in the helps.

        Comment


        • #5
          Re: Copy tables to new ADB

          Walter

          Sounds like a one time occurrence.

          If you copy the needed files to a new directory, create and empty database container, grab all of the dbfs and sets from windows explorer and drop them into the database tables/set tab.

          or...

          click the green plus sign and add all of the tables/sets in the directory to the database.

          or

          use Stan's suggestion of xbasic code

          I hope it's warm down there. Getting a little chilly up here.
          Al Buchholz
          Bookwood Systems, LTD
          Weekly QReportBuilder Webinars Thursday 1 pm CST

          Occam's Razor - KISS
          Normalize till it hurts - De-normalize till it works.
          Advice offered and questions asked in the spirit of learning how to fish is better than someone giving you a fish.
          When we triage a problem it is much easier to read sample systems than to read a mind.
          "Make it as simple as possible, but not simpler."
          Albert Einstein

          http://www.iadn.com/images/media/iadn_member.png

          Comment


          • #6
            Re: Copy tables to new ADB

            Hi All,

            Thanks for the replies.

            I have done the following and it solved my issue, looks like a one time occurrence like Al mentioned.


            My Steps:
            1. Created a new workspace folder
            2. created the new adb file in the new folder
            3. Copied all the *.dbf, *.cdx, *.fpt, *.dd*, *.se* files to the new folder: this step is important I think, otherwise the script below will add the files to your adb ok, but the file path will show the folder path of your copied files, which will result you need to get your files in the current workspace folder anyhow. The script below does not copy the files from one folde rto another.
            4. Then I run the script Stan provided, I like the visual effects to see the files being added, hehe
            'Date Created: 07-Jan-2015 05:14:26 AM
            'Last Updated: 07-Jan-2015 05:14:26 AM
            'Created By : CM001
            'Updated By : CM001
            'run the dbf lst, and after that, the set lst
            lst = filefind.get("c:\cms\advcpz\*.dbf",FILE_FIND_NORMAL,"PN")
            'lst = filefind.get("c:\cms\advcpz\*.se*",FILE_FIND_NORMAL,"PN")'set files

            Dim p3 as waitdialog
            p3.create(2,"repeating")
            p3.Set_Message("Importing files...")

            for each foo in lst
            p3.Set_Bottom_Message(foo.value)
            p3.Refresh()

            file_add_to_db(foo.value)
            next

            p3.close()
            5. Imported all the scripts and functions, menus and toolbars from the old adb, that was about 1400 items
            6. At this point I made a backup, with compact and index checking before that,
            7. Set the security on the new adb and set permissions
            8. Lastly I copied the ALphaDAO connection strings to our mysql server.
            9. Fired up the old horse, and bob is your uncle !!

            I do not get those errors any more, just glad it disappeared!

            Many thanks for all the help.

            Al, good to hear from you once more, yes the weather really nice, about 26 - 28 degrees(not Fahrenheit) with some nice rain in between. Yeah, we never get to see snow this side !! so enjoy !!
            Last edited by Walter; 01-07-2015, 12:55 AM.

            Comment


            • #7
              Re: Copy tables to new ADB

              et voilą!

              Walter wins again.

              Or was it Bob?

              I had not heard that expression before. Always good to increase the vocabulary.
              Al Buchholz
              Bookwood Systems, LTD
              Weekly QReportBuilder Webinars Thursday 1 pm CST

              Occam's Razor - KISS
              Normalize till it hurts - De-normalize till it works.
              Advice offered and questions asked in the spirit of learning how to fish is better than someone giving you a fish.
              When we triage a problem it is much easier to read sample systems than to read a mind.
              "Make it as simple as possible, but not simpler."
              Albert Einstein

              http://www.iadn.com/images/media/iadn_member.png

              Comment


              • #8
                Re: Copy tables to new ADB

                Hi Al,

                I think it was bob, Stan, Al this time !

                One thing I picked up just now, the original script does NOT import the sets.

                So I run the script again, but this time round I specified the sets to be added,

                'lst = filefind.get("c:\cms\advcpz\*.se*",FILE_FIND_NORMAL,"PN")'set files
                lst = filefind.get("c:\cms\advcpz\*.dbf*",FILE_FIND_NORMAL,"PN")
                That 's it - pressure off - just need to get the program for testing, the I can do the installation and deployment :)

                Comment


                • #9
                  Re: Copy tables to new ADB

                  If you don't want to write code, create the new database / workspace, open it to the tables/sets tab, and drag the dBF files from the open Windows folder (where they reside) into the white area of the tab.

                  100 tables might take a couple minutes, but it's pretty easy.

                  Comment


                  • #10
                    Re: Copy tables to new ADB

                    I would like to copy about 100 tables from one ADB to a new ADB.
                    Didn't see any mention of sets.
                    There can be only one.

                    Comment


                    • #11
                      Re: Copy tables to new ADB

                      Stan, is there way to copy all the files on one run , the tables and the sets then ?

                      Comment


                      • #12
                        Re: Copy tables to new ADB

                        I am not adding anything new, but to mention (from your initial post), that you are not really copying "from ADB to ADB". The ADB file has no knowledge of the files that are in the project. You are just copying files from one folder to another.
                        Steve Wood
                        Join the ALPHA DEVELOPERS NETWORK
                        There is no Cloud. It's just someone else's computer.
                        Web - Mobile - Hosting - Products - Frameworks - Developer Resources
                        AlphaToGo | IADN (100% Alpha Anywhere Websites)

                        Comment


                        • #13
                          Re: Copy tables to new ADB

                          Originally posted by MoGrace View Post
                          Couldn't you also copy the database and its files to a new directory and then rename the adb?
                          I do this all the time. After the file gets to a point to where it has too many forms, browses , grids or whatever. I duplicate the database (ok, workspace) and then weed out what I don't want in the new one. That way, I have a backup and I end up with a new adb name. I also use this method when breaking a flat file table down.
                          TYVM :) kenn

                          Knowing what you can achieve will not become reality until you imagine and explore.

                          Comment

                          Working...
                          X