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

PhoneGap Database Connection String

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

    PhoneGap Database Connection String

    Hi Everyone,

    I though I would post my experience with PhoneGap database connection strings - might save someone a bit of time in the future and also appreciate any comments as to what might be occurring.

    For my new PhoneGap project I have a connection string (Connection1) that maps to my local machine, but upon publishing to my server maps to the production database.

    However, for my PhoneGap application (which is pointing to my production server) it seemed to be of two minds.

    1) For any xBasic code or login functions it points to my prod database.

    2) For any list controls or drop downs with SQL lookups, it points to my development machine database.

    3) To add even more confusion, when running the app installed on its own on the phone this occurred, but in PhoneGap shell the app correctly points to my prod database in all instances.

    So basically, the app, going through a production alpha webserver, is sometimes pointing to my prod database and sometimes to my development machine...

    The solution, is to create a brand new connection string I called "PhoneGap" and map that to my prod database (on my development machine) and assign all components in the PhoneGap app to that connection string.

    Any idea why this might be occurring? Somehow my production alpha server has a "ghost" connection string to my local dev machine that the app is finding.

    Thanks Scott

    #2
    Re: PhoneGap Database Connection String

    It just seems to me that the lookups do not change, have you chosen the production server in the lookup and then found that it reverted? In other words drop-downs and lookups in the builders stay at whatever you tell them while the components make the switch, seems like the named string should always be used, but I think it may have something to do with when a JavaScript builder converts the whole thing to xbasic that it hard codes the connection string into the xbasic rather than to a pointer to the connection string.
    If I am waaaaay off base please forgive me but I seem to remember something similar about calculated fields gets converted so maybe the same thing is going on there...
    NWCOPRO: Nuisance Wildlife Control Software My Application: http://www.nwcopro.com "Without forgetting, we would have no memory at all...now what was I saying?"

    Comment


      #3
      Re: PhoneGap Database Connection String

      Sounds like there is some confusion going on here. And... since you can create a PhoneGap framework project using Alpha I think it's best to use specific terms. I'll assume you are talking about using PhoneGap Build... and not the PhoneGap Framework.

      So... using PhoneGap Build... there really isn't such a thing as a PhoneGap Build database connection string. There is only an AlphaDAO connection string. There is an Alpha PhoneGap Build builder Ajax Callback URL property.

      You're running and testing your project locally, using an AlphaDAO connection string pointing to a local database. Then you're publishing the project and you say...

      but upon publishing to my server maps to the production database
      How does it do that? Is your production sql server mapped exactly the same as your local sql server? E.g. same server name and relative location... like localhost?

      You're working locally... and... you're publishing to run "remotely". Those are usually 2 different connections and so you have to account for them.

      You don't say what your AlphaDAO connection string is. That would be helpful.

      I believe in order to run this stuff properly you need 2 AlphaDAO connection strings. Connection1 pointing to your local database. Connection1_remote pointing to your non-local, hosted, somewhere else database.

      When you're ready to publish, rename your connection strings appropriately.

      It's a bit different when doing work for a client. Their connection string is named Connection1 and they are doing the publishing. I can use Connection1 locally because in my development environment I have Connection1 defined as point to a local database. When I send a component to a client, Connection1 is already set for the component and they can simply publish without changes.

      Comment


        #4
        Re: PhoneGap Database Connection String

        Hi Charles/David,

        Thanks for the feedback. Let me provide a bit more information. David is correct I am referring to AlphaDAO connection string with PhoneGap Build. I guess what I meant is that with Alpha "Connection1" on your local machine can be setup to point to my development database, and in the publishing profile for my production server "Connection1" can be set to point to my production database. The advantage of this of course is you can use the same AlphaDAO connection name or pointer in your xBasic/Components and it makes publishing much easier.

        So I had assumed that when you instruct the PhoneGap app to hit a certain Alpha Server for Ajax Callbacks that by default all interactions would default to the Connection1 as defined on the production server. But that doesn't seem to be the case...

        It would appear that for the integrated login and ajax callbacks it does access "Connection1" as defined for that production server, but for other instances as Charles points out it takes Connection1 as defined at the time of compiling up to PhoneGap, which on my machine is pointing to my local MySQl database...

        Comment


          #5
          Re: PhoneGap Database Connection String

          You publish to your server... and your connection string... Connection1... gets published to your server... as it is currently defined in your dev environment. When you publish a component to your server, your AlphaDAO connections get published as well.

          With PhoneGap Build it may "seem" like you're pulling data from your local server because the building process "can" take some local data with it... depending on how you've built your app. This is why... without any connection... a List control in a newly installed app has data... by default... unless you set it up not to.

          It has nothing to do with taking Connection1 as defined at the time of compiling... how could it? PhoneGap Build has nothing to do with Connection String definitions. Connection string definitions exist only at the server level.

          You need to ensure that, at the time of publishing, and you want to test your app with your Production server, that your connection string is pointing to your production server.

          Then you need to ensure, if you want to, that data controls carry no data with them during the build process... or that you refresh the data for those controls as and when need be.

          Have a look at the generated index.html file after Alpha has built the files for a PhoneGap Build build. By default, for some controls, you'll see data in there.

          Comment


            #6
            Re: PhoneGap Database Connection String

            Hi David,

            Yep will do. I do think as an improvement Alpha could add a PhoneGap AlphaDAO connection string for compiling when uploading to PhoneGap.

            Cheers,

            Scott

            Comment


              #7
              Re: PhoneGap Database Connection String

              But that's not how it really works.

              Alpha let's you set the Ajax Callback URL to your server. The server does it's job and figures out the connection string from what you published to the server.

              I believe what could be useful to you is Alpha's Dynamic Connection String. Have a look in the release notes for "AlphaDAO - Connection Strings - Dynamic".

              You could pass something from your app to the server, and the XBasic function of the Dynamic Connection string could figure out what it needs to do based on what's passed from your App.

              I also believe, however, that your App... the data controls, are not set up correctly for what you want to accomplish. That's what it seems like.

              Comment

              Working...
              X