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

Post / Append to external database

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

    Post / Append to external database

    I have 5 similar databases in 5 separate folders. Tablenames are identical in each database.
    All databases contain a table named Constransactions.dbf

    In one of these databases (NIMSInternational) users enter records that are uniquely identified by a field that designates which database they are to be posted to (so I know which of the other 4 databases is the target for the record).

    After a few records (say 100 or so) have been entered in the NIMSInternatioinal database, I want to 'Post' each record to the correct target database. This would be easy if all Constransaction.dbf tables were in the same folder in the NIMSInternational database... but the tables have the same name.

    I could leave the Constransaction.dbf tables in their individual folders and add all of these tables to the NIMSInternational database... then create Append Opperations... but since these tables are in different folders/databases this would make the app difficult to transport to other computers / drive letters C: L: K: etc.

    I could export the records as .csv or .txt from the NIMSInternational database and then individually import them back to each database... but I would rather have this happen automatically from the NIMSInternational database without user actions in the other individual databases.

    Is there a way to 'Post' these records from the NIMSInternational database to the external databases so that no user action is required in the individual (target) databases?

    #2
    Active-Link to .dbf table

    Is it possible to create an Active-Link (.dbf) table in one database that has a connection string to a .dbf table in another database on the same computer / drive letter?

    I have tried to create a connection string to enable this but I cannot see where I can enter a path or table reference... and ODBC data sources do not seem to work.

    Comment


      #3
      Re: Post / Append to external database

      You could create a field rule event, probably for the cansaverecord, to add records to other tables. That would still require hard coding the drive letters and paths.
      There can be only one.

      Comment


        #4
        Re: Active-Link to .dbf table

        ODBC data sources would work if you had a dbf driver. I don't think such is available these days.
        There can be only one.

        Comment


          #5
          Re: Active-Link to .dbf table

          David

          Why an active link to another dbf? Active link is designed to connect to non-dbf tables.

          Add the dbf table to the database and point to the directory that it is located in.

          While most suggest that all tables should be in one directory, it is not a requirement.
          More of an ease of use for casual users/developers.
          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: Post / Append to external database

            I could leave the Constransaction.dbf tables in their individual folders and add all of these tables to the NIMSInternational database... then create Append Opperations... but since these tables are in different folders/databases this would make the app difficult to transport to other computers / drive letters C: L: K: etc.
            If you work with this concept and create the append operations, then capture the xbasic for same, and modify the xbasic to reference A5.GET_PATH() instead of just using the tablename then you should be able to make the appends portable.
            There can be only one.

            Comment


              #7
              Re: Active-Link to .dbf table

              Thanks Stan... I could not get any ODBC driver to work.

              Thanks Al... I will likely end up doing as you suggest... I will run into a few problems because I develop on a computer on the L: drive and deploy to a computer that uses the C: drive... bit of an inconenience... but I will work with it.
              although...
              I'm still toying with the option of Exporting each set of Transactions to an XL file in the NIMSInternational... then placing a button on a form in each individual database that enables the user to point to NIMSInternational and automatically import the XL file that is unique to the individual database.

              Comment


                #8
                Re: Post / Append to external database

                Thanks Stan!
                ... good idea... I will give it a try.

                Comment


                  #9
                  Re: Post / Append to external database

                  Didn't work as well as I hoped...
                  The problem is that when deployed the target Constransactions.dbf table cannot be easily defined... A5.Get_Path() works ok for the Source file... but not the target:
                  'Date Created: 02-Nov-2017 04:03:58 PM
                  'Last Updated: 02-Nov-2017 04:03:58 PM
                  'Created By : David Boomer
                  'Updated By : David Boomer
                  'RATS... !!! THIS WON'T WORK BECAUSE TARGET CANNOT BE DEFINED WHEN APP IS DEPLOYED... so I will use export to XL from NIMSInternational and and Import to Individual

                  'AppendTransCDN
                  'This script appends CDN Transactions in the NIMSInternational database to Transactions in the Canadian database

                  DIM Append as P

                  'a_tbl = table.open("L:\NIMS\NIMSDEV\NIMSCDNDEV\constransactions.dbf")
                  'append.t_db = "L:\NIMS\NIMSDEV\NIMSINTDEV\constransactions.DBF"

                  dim SourcePathFileVar As C
                  dim TargetPathFileVar As C

                  SourcePathFileVar = A5.GET_PATH() + "\Constransactions.dbf"
                  TargetPathFileVar = "???" 'this won't work because when the app is deployed on a different drive\directory the target is not explicitly or implicitely defined by the a5.Get_Path() function

                  a_tbl = table.open("L:\NIMS\NIMSDEV\NIMSCDNDEV\constransactions.dbf")
                  append.t_db = SourcePathFileVar


                  ON ERROR GOTO ERROR02112017154522612


                  append.m_key = ""
                  append.t_key = "recno()"
                  append.m_filter = ""
                  append.t_filter = "left(Consprimekey,3) = "CDN""
                  append.type = "All"
                  append.m_count = 14
                  append.m_field1 = "Transactnum"
                  append.m_exp1 = "@constransactions->TRANSACTNUM"
                  append.m_field2 = "Consultnum"
                  append.m_exp2 = "@constransactions->CONSULTNUM"
                  append.m_field3 = "Consprimekey"
                  append.m_exp3 = "@constransactions->CONSPRIMEKEY"
                  append.m_field4 = "Transdate"
                  append.m_exp4 = "@constransactions->TRANSDATE"
                  append.m_field5 = "Transaction"
                  append.m_exp5 = "@constransactions->TRANSACTION"
                  append.m_field6 = "Amount"
                  append.m_exp6 = "@constransactions->AMOUNT"
                  append.m_field7 = "Transtypenum"
                  append.m_exp7 = "@constransactions->TRANSTYPENUM"
                  append.m_field8 = "Transtype"
                  append.m_exp8 = "@constransactions->TRANSTYPE"
                  append.m_field9 = "Chargedamount"
                  append.m_exp9 = "@constransactions->CHARGEDAMOUNT"
                  append.m_field10 = "Postapproved"
                  append.m_exp10 = "@constransactions->POSTAPPROVED"
                  append.m_field11 = "Approveddate"
                  append.m_exp11 = "@constransactions->APPROVEDDATE"
                  append.m_field12 = "Postedtomonthly"
                  append.m_exp12 = "@constransactions->POSTEDTOMONTHLY"
                  append.m_field13 = "Posteddate"
                  append.m_exp13 = "@constransactions->POSTEDDATE"
                  append.m_field14 = "Region"
                  append.m_exp14 = "@constransactions->REGION"
                  append.t_count = 0

                  'Prompt for confirmation before running the Operation.......
                  dim rec_count as n

                  rec_count = a5_get_records_in_query("L:\NIMS\NIMSDEV\NIMSINTDEV\constransactions.DBF",append.t_filter,-1,.f.)
                  message_text = "A maximum of "+rec_count + " record(s) will be appended from 'L:\NIMS\NIMSDEV\NIMSINTDEV\constransactions.DBF', to 'constransactions'. "+crlf(2)+ "OK to proceed?"
                  operation_result=ui_msg_box("Append Operation",message_text,UI_OK_CANCEL+ UI_FIRST_BUTTON_DEFAULT+ UI_INFORMATION_SYMBOL)
                  If operation_result <> ui_ok_selected then
                  end
                  end if


                  a_tbl.append()


                  GOTO CONTINUE02112017154522612
                  ERROR02112017154522612:
                  ON ERROR GOTO 0
                  ui_msg_box("Error","Error running Append Operation"+crlf()+error_text_get())
                  END
                  CONTINUE02112017154522612:
                  a_tbl.close()

                  'Display a dialog box showing the results of the Operation

                  dim args as sql::arguments
                  if eval_valid("arguments") then
                  if typeof(arguments) = "P" then
                  args = arguments
                  end if
                  end if

                  a5_append_op_result(a_records_processed,a_records_total,a_records_violated, "constransactions","Append Operation Result",args)

                  'If the Operation is run from within a Form or Browse, then refresh the window
                  if is_object(topparent.this) then
                  if topparent.Class() = "form" .or. topparent.class() = "browse" then
                  topparent.Refresh_layout()
                  end if
                  end if



                  Comment


                    #10
                    Re: Active-Link to .dbf table

                    I don't understand the reference to NIMSInternational.

                    It must be something that is involved in your application that hasn't been described.....

                    Is this a reference to what you described in this thread?
                    https://www.alphasoftware.com/alphaf...ernal-database

                    Should I merge the threads?
                    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


                      #11
                      Re: Active-Link to .dbf table

                      Yes... they are related posts... The main problem was described in https://www.alphasoftware.com/alphaf...ernal-database...

                      The Post about Active-Link tables was exploring the possibility of using them in an Append operation to solve the problem of posting from NIMSInternational to the other databases.

                      Comment

                      Working...
                      X