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

API_UUIDCREATE() and Sql Server

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

    API_UUIDCREATE() and Sql Server

    I have a grid that is not saving the GUID into SQL Server 2008 table. The field is called PrimaryID with Data Type uniqueidentifier.

    The Column Properties has Default Value is set with (newid()) and property RowGuid is set to Yes.

    My grid is updateable with one row to insert new record. The PrimaryID field has no Initial value set. I am setting this in the Server-side Events: CanInsertRecord with this code: DataSubmitted.PrimaryID = API_UUIDCREATE()

    It works fine on my local machine. Adding several records with no errors.

    I publish app on the WAS server okay. When I add new data and click Submit I receive Error message stating: "Record was not inserted ... Function requested was not supported".

    Please help with saving GUID record ID.

    Thanks.

    #2
    Re: API_UUIDCREATE() and Sql Server

    The field type in the database would be a CHAR size 40 with NO formula of any kind. It can and should be the PK but just a normal CHAR.

    If you use remspecial(api_uuidcreate()) it is a little cleaner, size 32 with no dashes.
    Steve Wood
    See my profile on IADN

    Comment


      #3
      Re: API_UUIDCREATE() and Sql Server

      So you saying to only change the table structure ?

      Comment


        #4
        Re: API_UUIDCREATE() and Sql Server

        Yes. From what you are saying, you are generating a GUID in Alpha and populating the table with that GUID. But you also seem to be setting the table to also generate a GUID. I don't know what newid() and RowGuid are, but they sound like GUID generation formula. An Alpha-generated GUID is just a character value.
        Steve Wood
        See my profile on IADN

        Comment


          #5
          Re: API_UUIDCREATE() and Sql Server

          See attached Column Properties

          GUID_1.JPG

          Comment


            #6
            Re: API_UUIDCREATE() and Sql Server

            OK, that is fine but you still have to pick which method you are going to use to create a GUID. You are currently setting a GUID using newid() and then trying to shove a text value into the same filed using DataSubmitted.PrimaryID = API_UUIDCREATE().
            Steve Wood
            See my profile on IADN

            Comment


              #7
              Re: API_UUIDCREATE() and Sql Server

              Originally posted by harrison4411 View Post
              See attached Column Properties

              [ATTACH=CONFIG]39752[/ATTACH]
              take a look at your attached image, the size of the column is 16 not compatible with uuid from alpha, api_uuidcreate() function creates 40 char field when you remove the hyphens it becomes 32.
              you should follow what steve said: create char field in sqlserver and let alpha create the id to populate it. you can keep the hyphens or remove them, when you remove it looks better, not sure they work better.
              thanks for reading

              gandhi

              version 11 3381 - 4096
              mysql backend
              http://www.alphawebprogramming.blogspot.com
              [email protected]
              Skype:[email protected]
              1 914 924 5171

              Comment


                #8
                Re: API_UUIDCREATE() and Sql Server

                My need understanding why the app works running off my desktop that uses same SQL server table. Note attached pictures and records created. Picture GUID_2 is using localhost:8011/LivePreview show record can be added.
                Attachments GUID_3 and GUID_MSG are from browser running deployed grid.
                I don't understand why it doesn't work from production.

                GUID_msg.JPG GUID_3.JPG GUID_2.JPG

                Comment


                  #9
                  Re: API_UUIDCREATE() and Sql Server

                  I don't use MSSQL, but in my few seconds of research, your values in your screenshots are all from using RowGrid + uniqueidentifier + newid().

                  If that works for you, then omit your code in CanInsertRecord.

                  Here is an article on the subject (which both supports and denounces using RowGrid: http://sqlservernewbie.blogspot.com/...6/rowguid.html

                  I don't use MSSQL because frankly it confuses the heck out of me compared to MYSQL/MariaDB.
                  Steve Wood
                  See my profile on IADN

                  Comment


                    #10
                    Re: API_UUIDCREATE() and Sql Server

                    Your error may have nothing to do with the data type or the function used to create the primary key value. If it did, the error would be in the xbasic code and would never attempt to INSERT the record.

                    If the error is coming from SQL Server (which is likely from the message), that indicates the machine with the Alpha Anywhere app server may not be using the correct SQL Server Native Client. SQL Server 2008 would used Native Client 10, while SQL Server 2012 and 2014 use Native Client 11. If you have the wrong driver installed on the machine, you may get the function not supported error.

                    The documentation gives some info on this under the topic "How to Connect to SQL Server from 64-bit Windows". You can also search the Alpha Anywhere release notes for "Native Client" for information. Microsoft has information on the latest drivers at

                    http://www.microsoft.com/en-us/downl....aspx?id=36434

                    If using a uniqueidentifer in SQL Server, you may need to pass in a guid type in some contexts, not character.

                    The function *guid_create() will create a variable of the type needed, which is identified as a "k" type in Alpha Anywhere. You can useAPI_UUIDCREATE() when passing in as character. Since you are using "DataSubmitted", that is always character so DataSubmitted.PrimaryID = API_UUIDCREATE() is appropriate. You can als0 use convert_type to change types, and the function isNonNullGuid() to see if the value is a value uniqueidentifier. That function accepts "K" or "C" type values.
                    Code:
                    ?*guid_create()
                    = "{9d75f4b8-a776-4ba7-823b-c53ed2be22f6}"
                    
                    ?typeof(*guid_create())
                    = "K"
                    
                    ?API_UUIDCREATE()
                    = "144affaf-dc07-4e06-83ae-5e78289dcc62"
                    
                    ?typeof(API_UUIDCREATE())
                    = "C"
                    
                    newGuid = convert_type(API_UUIDCREATE(),"K")
                    ?typeof(newGuid)
                    = "K"
                    ?NewGuid
                    = "{c11fb3b9-86c9-472d-af59-6811fb34ef3e}"
                    
                    NewGuidC = convert_type(*guid_create(),"C")
                    ?typeof(newGuidc)
                    = "C"
                    
                    ?newGuidC
                    = "{add9e5ef-0919-486b-89fa-a648bd8bad67}"
                    
                    ?isnonnullguid(*guid_create())
                    = .T.
                    
                    ?isnonnullguid(API_UUIDCREATE())
                    = .T.

                    Comment


                      #11
                      Re: API_UUIDCREATE() and Sql Server

                      Jerry,
                      Right now I am testing and deploying on same server. So Native SQL would be same driver since both WAS and Desktop versions are same: Build 3381 Addins: 4096 and both hit the same SQL 2008 Server. Yes ?

                      Also I can make updates and have them saved without errors from both Local and productions browser.

                      Is there a way you want me to check the server version and the desktop SQL version ?

                      This is connection string:
                      {A5API='SQLServer',A5DBVersion=2008,Server='Eggroll',A5ANSINullPadWarn=Default,UserName='Harrison',Password='��������',Database='BloodTracker'}
                      Last edited by harrison4411; 02-12-2015, 02:44 PM.

                      Comment


                        #12
                        Re: API_UUIDCREATE() and Sql Server

                        Jerry, Thanks for the instructions. Yes the drive was 6.0 and not Native SQL 10 or above. I download ODBC and Native drive. Tested and back in the game.

                        Thanks VERY MUCH. :)

                        Attached Files: Server ODBC and Workstation ODBC driver tab.


                        odbc_Server.JPG odbc_workstation.jpg

                        Comment

                        Working...
                        X