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

Pre-release Multi-Tenant Connection String

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

    #16
    Re: Pre-release Multi-Tenant Connection String

    Is this thread still valid?

    There is new pre release. I wait your reports of it:)

    Comment


      #17
      Re: Pre-release Multi-Tenant Connection String

      Its valid if you test the feature and it works
      Alex Collier

      "The spread of computers and the Internet will put jobs in two categories. People who tell computers what to do, and people who are told by computers what to do"

      AA Builds from 5221_5152 to Pre-releases >> Deploying to IIS in AWS

      Comment


        #18
        Re: Pre-release Multi-Tenant Connection String

        Originally posted by alexc View Post
        David i have tried breaking it and it simply works so not sure what you are doing different. Can someone else test this feature.

        The {if} in SQL Query was in the release prior so don't think is related and does not seem to affect it anything. Must be an expression not fully evaluating when displaying in the alpha developer
        The {lf} are purely cosmetic. alpha now preserve line breaks when editing field properties. you will notice that when you click in the sql statement field, it shows as a multi-line item.
        Alex Collier

        "The spread of computers and the Internet will put jobs in two categories. People who tell computers what to do, and people who are told by computers what to do"

        AA Builds from 5221_5152 to Pre-releases >> Deploying to IIS in AWS

        Comment


          #19
          Re: Pre-release Multi-Tenant Connection String

          Using today's pre-release, full install, new UX... I'm getting the same bad results.

          Alex... going back to a previous point... if I go to my AlphaDAOConnection strings, and edit one of my Tenant Connections, an "Edit Alpha DAO Connection" dialog will open. If I click on the "Build" button a "Select an API" dialog opens. From this point I must re-built my connection string. Is this not happening for you?

          If I then select "MultiTenant" and fill in the connection string properties and then click the "Test Connection" button... nothing happens. If can click OK and then click the "Test connection" link and that will test the connection.

          Are you not seeing any of this?

          Comment


            #20
            Re: Pre-release Multi-Tenant Connection String

            Originally posted by Davidk View Post
            Using today's pre-release, full install, new UX... I'm getting the same bad results.

            Alex... going back to a previous point... if I go to my AlphaDAOConnection strings, and edit one of my Tenant Connections, an "Edit Alpha DAO Connection" dialog will open. If I click on the "Build" button a "Select an API" dialog opens. From this point I must re-built my connection string. Is this not happening for you?

            If I then select "MultiTenant" and fill in the connection string properties and then click the "Test Connection" button... nothing happens. If can click OK and then click the "Test connection" link and that will test the connection.

            Are you not seeing any of this?
            When i click the build button to edit it goes straight into the connection properties for multi-tenant. I have noticed the Test Connection button does not work as you mentioned.
            Alex Collier

            "The spread of computers and the Internet will put jobs in two categories. People who tell computers what to do, and people who are told by computers what to do"

            AA Builds from 5221_5152 to Pre-releases >> Deploying to IIS in AWS

            Comment


              #21
              Re: Pre-release Multi-Tenant Connection String

              Thanks Alex... appreciated.

              In build 5221, my AlphaDAO connection strings open properly when edited. In yesterdays and todays pre-release existing connection strings are not recognized and go through a new build process when edited. Even connection strings I've had for years no longer edit.

              Something in these pre-releases is quite broken for me.

              Comment


                #22
                Re: Pre-release Multi-Tenant Connection String

                I put in a new install of 5221. I can edit AlphaDAO connection strings. Then I updated that install with build 5417. I can no longer edit AlphaDAO Connection Strings.

                So... beware 5417.

                Comment


                  #23
                  Re: Pre-release Multi-Tenant Connection String

                  For anyone wanting to use a Character based TenantId for a Multi-Tenant Connection String, here is the bug fix you need to implement.

                  Go through the process of creating a Mutli-Tenant Connection string, as shown in Selwyn's video, https://www.youtube.com/watch?v=IM3ul66RcGQ
                  You must select XbasicCustom as the ConnectionType in order to have the XBasic class built for you. Then you can correct the code.

                  Once the XBasic Class is created, edit the function named "query". Around line 166 you'll see this code... which is correct code...

                  Code:
                  			if left(TenantIDFieldType,1) = "C" then 
                  				_tenantId = stritran(_tenantId,"'","''")
                  				dim whereStatement as c = _tenantidfieldname  + " = '" +_tenantId + "'"
                  			else
                  				dim whereStatement as c = _tenantidfieldname  + " = " +_tenantId
                  			end if
                  Here Alpha is checking for the TenantId field type. If it's "C" (character) then they are wrapping the value of _tenantId in quotes. _tenantId is the tenant session variable. All good.

                  Right after this section of code is this...

                  Code:
                  			if se.where.SQLStatement <> "" then
                  				whereStatement = se.where.SQLStatement + " and "+_tenantidfieldname+" = "+_tenantId
                  			end if
                  If there is already a "where" statement in place (one that you have added to your List as a filter) then append the additional tenant whereStatement to it. However, note the missing field type test and, if Character, the missing quotes.
                  This is why the Multi-tenant sql statement fails if the tenandId is Character and you have additional where statements.

                  To fix this, I commented out the code which tests for a where statement and added code to the section where the TenantIDFieldTType is tested. This code works...

                  Code:
                  			if left(TenantIDFieldType,1) = "C" then 
                  				_tenantId = stritran(_tenantId,"'","''")
                  				dim whereStatement as c = _tenantidfieldname  + " = '" +_tenantId + "'"
                  				if se.where.SQLStatement <> "" then
                  					whereStatement = se.where.SQLStatement + " and "+_tenantidfieldname+" = '" +_tenantId + "'"
                  				end if			
                  			else
                  				dim whereStatement as c = _tenantidfieldname  + " = " +_tenantId
                  				if se.where.SQLStatement <> "" then
                  					whereStatement = se.where.SQLStatement + " and "+_tenantidfieldname+" = "+_tenantId
                  				end if				
                  			end if
                  The Multi-tenant feature wasn't tested for a Character Type tenantId. Why it worked for Alex is a complete mystery to me.

                  Comment


                    #24
                    Re: Pre-release Multi-Tenant Connection String

                    1) Appending an expression like that to the existing "WHERE" clause is not safe; you may get unintended results. It is much safer to wrap both expressions in parentheses. Or, in this case we know the second expression is a simple one: fieldx = valuey. So, we just need to wrap the existing WHERE clause in parenthesis before appending the tenant id expression. Run the following example in a query window that I found here: https://stackoverflow.com/questions/...nce-and-and-or
                    Code:
                    Declare @x tinyInt = 1
                    Declare @y tinyInt = 0
                    Declare @z tinyInt = 0
                    Select Case When @x=1 OR @y=1 And @z=1 Then 'T' Else 'F' End -- outputs T
                    Select Case When (@x=1 OR @y=1) And @z=1 Then 'T' Else 'F' End -- outputs F
                    We hope that both select statements will output the same result, but they won't. We need those parenthesis to get what we want. So, I hope that Alpha knows to put those parentheses in when they combine base filters with users filters elsewhere in the system and that alpha knows that both expression are going to need surrounding parenthesis.

                    2) To guard against SQL injection a SQL::Argument must be used there. Sure, it is supposed to be difficult for hacker to change the value of a session variable by altering code on the client-side. But I suspect it really isn't that hard to alter a session variable maliciously.

                    3) I use a GUID as a tenant ID. I hope Alpha tests those out as well. Alpha may have to know to set the argument type to "K" when adding them into a SQL::Arguments object (assuming they fix the demonstrated code to use arguments).

                    Comment


                      #25
                      Re: Pre-release Multi-Tenant Connection String

                      Originally posted by RichCPT View Post
                      But I suspect it really isn't that hard to alter a session variable maliciously.
                      It has to be very hard otherwise the hole concept is broken. You can change cookie but not session variable. If some one can change session variable it means that your server has been exploited.

                      Comment

                      Working...
                      X