Alpha Video Training
Results 1 to 17 of 17

Thread: cant find named connection

  1. #1
    Volunteer Moderator Steve Wood's Avatar
    Real Name
    Steve Wood
    Join Date
    Nov 2003
    Location
    Bay Area, California
    Posts
    8,842

    Default cant find named connection

    I came back from the AlphaU experience determined to move several apps from DBF to SQL. Converting the tables was easy, simply export to my sql database connection.

    I do have a couple questions/problems once I move the database to my server.

    - what is the proper authentication for the server - I set it up as windows authentication, which I believe is incorrect.
    - In server properties, should the server log on as Built-in Account (network service, local system, local service) or as a specific named account?

    When I attempt to access a grid on the server, I get the error message below. I believe this is due to inability to log in to the sql server.

    Error opening Grid table/view: Internal Error - Can't find named connection
    'trinav' - while converting named connection to connection string
    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)

  2. #2
    Member parri2bd's Avatar
    Real Name
    Benjamin Parrish
    Join Date
    Oct 2007
    Posts
    102

    Default Re: cant find named connection

    Steve -

    When you run the wizard to add a new connection to your project you should see a for field form that pops up for you to put information into.

    Server
    Port
    User
    Password

    Server = (local)
    Port = 3306 (<-- this is the default port MySQL uses when it is configured)
    User = root
    Password = <Your Password>

    Alpha should create something that looks like this ...

    {A5API=MySQL,Server='(local)',Port='3306',UserName='root',Password='åúðáóó÷ïòä'}

    When you originally configured MySQL you had to choose a password for the "root" and you selected a port. The Server name will change if it is not on your local machine.

    I hope this points in the right direction.

    CAVEAT: This is the answer if you set your MySQL up with most of the default settings. Alpha doesn't seem to ask for Windows Authentication like it does in the SQL Server connection wizard.

  3. #3
    Member
    Real Name
    Ed Moss
    Join Date
    Feb 2009
    Posts
    16

    Default Re: cant find named connection

    Steve,
    Are you using Mysql or Microsoft SQL Server.
    If Microsoft, what version, and do you have the Management Console installed on the SQL server?

    Ed

  4. #4
    Volunteer Moderator Steve Wood's Avatar
    Real Name
    Steve Wood
    Join Date
    Nov 2003
    Location
    Bay Area, California
    Posts
    8,842

    Default Re: cant find named connection

    MSSQL Server 2008 with Mgmt Console.
    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)

  5. #5
    Member
    Real Name
    Ed Moss
    Join Date
    Feb 2009
    Posts
    16

    Default Re: cant find named connection

    Steve,
    As you know, I'm brand new to Alpha Five and its' "genies" for connecting to SQL, , but I have experience in connecting apps to SQL , so I'll attempt to help you.

    1. You can authenticate using either method, or mixed mode - "SQL server and Windows". For your purposes, I'd recommend SQL server using either the default SA account, or a new named login.

    2. In server properties, I've always used a "specific named account" for connections. Giving an application access to any of the local accounts opens up the whole server, and should not be required.

    3. Often overlooked; Once you decide on the authentication method and an ID and password, you have to manually grant database access for that user or Database Role to the specific database you wish to use. Microsoft describes this in this way;

    ==========================================================================
    To grant database access

    1. Locate the Users folder for the database you want to grant access to, right-click, and click New Database User.
    2. Select the Login name from the drop-down list and click OK. The database user name defaults to the same name.
    3. Select Database Roles, right-click and then click New Database Role.

    Avoid granting permissions to individual database users because the database user name may change and/or additional users may require the same permissions. Instead, grant permissions to database roles.
    4. Enter a role name and select the Database Role type as Standard Role. Click the Add button, add the new user you created, and click OK.
    5. Select the new role, right-click, and then click Properties.
    6. Click Permissions. Locate the relevant stored procedures, and grant the EXEC (execute) permission to these objects.

    By default, a new database role has no permission to read the base tables or views in the database and cannot execute stored procedures. It is best practice to grant permissions to stored procedures and views because then you can control what users can read and update.
    ==========================================================================
    As an alternative to using Enterprise Manager, you can run the following database script to perform the steps outlined above.

    -- Create a new SQL Server Login
    exec sp_addlogin @loginame = 'MyUser', @passwd = 'P@ssw0rd'
    -- Grant the SQL login access to your database.
    -- Create a database user called WebAppUser to which the login is associated
    Use YourDatabase
    GO
    exec sp_grantdbaccess 'MyUser'
    -- Create a user-defined database role.
    exec sp_addrole 'WebAppUserRole'
    -- Add the database user to the new database role.
    exec sp_addrolemember 'WebAppUserRole', 'MyUser'
    -- Grant the role execute permissions on the stored procedure called sprocname
    grant execute on sprocname to WebAppUserRole


    I hope you find this helpful.

    Regards,

    Ed

  6. #6
    "Certified" Alphaholic
    Real Name
    Frank Bicknell
    Join Date
    Feb 2010
    Location
    39.1915° N, 84.4348° W
    Posts
    2,467

    Default Re: cant find named connection

    Steve,

    I was having the same issue when I first started. I knew I had a valid connection string because it was saved, it was in the list of connection strings, I could select the tables and I could build the grids. When I went to run I had the same error.
    I am not sure what happened but the problem went away. Could have been the patch or I think after I published a few times??

  7. #7
    Volunteer Moderator Steve Wood's Avatar
    Real Name
    Steve Wood
    Join Date
    Nov 2003
    Location
    Bay Area, California
    Posts
    8,842

    Default Re: cant find named connection

    I got it to work. What did I do? I remembered to Activate the database after uploading it from my laptop via FTP.
    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)

  8. #8
    Member
    Real Name
    JBrown
    Join Date
    Jan 2010
    Posts
    23

    Default Re: cant find named connection

    Quote Originally Posted by Steve Wood View Post
    I got it to work. What did I do? I remembered to Activate the database after uploading it from my laptop via FTP.
    Hey Steve,

    I am having the same problem, "Can't find named connection" after creating a profile and publishing to production from my desktop development environment. (A server that I don't control) You mentioned that you activated the database, could you expand on that a bit. Shouldn't the various named connections get published with whatever profile was created for that purpose?
    Wisdom is foundational, then add to that knowledge

  9. #9
    Member
    Real Name
    Wolfgang Marcus Zwing
    Join Date
    Jul 2009
    Posts
    111

    Default Re: cant find named connection

    Hi

    I had the same problem on my development machine immediately after I changed the named connection by creating a new one to point to a different MYSQL database with the same structure.

    The connection information ist stored in a text file called a5_application.a5i under A5Webroot\yourapp . When I opened that file I noticed that it still pointed to the wrong database, which didn't exist anymore, although I had re-published. I deleted that file and opened every grid and refreshed the connection and the field list , then saved and published from scratch. Then I could connect and the error message disappeared.

    Hope this helps.

    Cheers

  10. #10
    Member
    Real Name
    JBrown
    Join Date
    Jan 2010
    Posts
    23

    Default Re: cant find named connection

    Quote Originally Posted by wmz View Post
    Hi

    I had the same problem on my development machine immediately after I changed the named connection by creating a new one to point to a different MYSQL database with the same structure.

    The connection information ist stored in a text file called a5_application.a5i under A5Webroot\yourapp . When I opened that file I noticed that it still pointed to the wrong database, which didn't exist anymore, although I had re-published. I deleted that file and opened every grid and refreshed the connection and the field list , then saved and published from scratch. Then I could connect and the error message disappeared.

    Hope this helps.

    Cheers
    WMZ,

    Not sure how you found this nugget but thanks. It worked. I delete this files and everything else and republished. Do you know of a black box reference for Alpha 5 related items. For example, I discovered that putting a grid on a tabbedUI has problems, but if you put the grid component on an A5W page then put that page on the tabbedUI, it works fine. Very interesting...
    Wisdom is foundational, then add to that knowledge

  11. #11
    Member
    Real Name
    Wolfgang Marcus Zwing
    Join Date
    Jul 2009
    Posts
    111

    Default Re: cant find named connection

    Hi JaxxB

    Not sure which problems you encountered with a grid in a tabbedUI, however, I have heard similar before. If it persists, I would suggest to report this as a bug.

    cheers,

    Wolfgang

  12. #12
    Member
    Real Name
    JBrown
    Join Date
    Jan 2010
    Posts
    23

    Default Re: cant find named connection

    Hey Wolfgang,

    Maybe I spoke to soon, the "Can't find named connection" problem resurfaced, after I changes all my "named connections" and republished. I'm sure it's somethings simple. I delete the a5_application.a5i as suggested. Stopped and restarted the a5 app server and republished. Same problem. I wish there was a log of sort, that would provide more details.
    Wisdom is foundational, then add to that knowledge

  13. #13
    Member
    Real Name
    Wolfgang Marcus Zwing
    Join Date
    Jul 2009
    Posts
    111

    Default Re: cant find named connection

    Don't know. Can you access the DB in any of the preview modes? Can you connect the grid in edit mode, i.e. Query (AlphaDAO) section in the grid properties? Refreshed the fields?

    If so and it still ain't working when you publish, I'd report a bug.

    regards

    PS: Forgot to mention the profiles. Updated these as well?

  14. #14
    "Certified" Alphaholic mmaisterrena's Avatar
    Real Name
    Mauricio Maisterrena
    Join Date
    Nov 2006
    Location
    Torreon, Mexico
    Posts
    1,435

    Default Re: cant find named connection

    happening to me too works on preview but not when publishing to the production server
    and I dont find a way to republish the alpha Dao strings
    Last edited by mmaisterrena; 05-21-2010 at 01:51 PM.
    Cheers
    Mauricio


  15. #15
    "Certified" Alphaholic chadbrown's Avatar
    Real Name
    Chad Brown
    Join Date
    Aug 2007
    Location
    Aurora, Ontario, Canada
    Posts
    1,412

    Default Re: cant find named connection

    Try doing a recompile all files and delete the a5_application.a5i file and republish. It worked for me.
    Chad Brown

  16. #16
    Member
    Real Name
    Roelof
    Join Date
    Jul 2008
    Location
    Seattle, WA
    Posts
    763

    Default Re: cant find named connection

    I have experienced the same, specifically when you copy items from one web design to the next.

    The way I do it is
    - Click on publish
    - Click on add edit profile
    - Click on Edit named connection Strings
    - find your connection string and edit it

    I have found out that for some reason it changes it to default value.
    Upload and bingo it works again

  17. #17
    Member
    Real Name
    Clive Swanepoel
    Join Date
    Apr 2006
    Location
    Johnston, Iowa
    Posts
    119

    Default Re: cant find named connection

    We experienced the same problem after migrating a Hyper-V from the Texas datacenter to the UK datacenter.

    We resolved the problem by:

    1. Re-running the Alpha patch
    2. Running MySql Install and selecting Repair.

    Not sure which of the two fixed the problem.
    Affordable Alpha Five, PHP, MySQL Hosting.
    Serving Webmasters since 2000.ZebraHost

Similar Threads

  1. Named browse in form
    By nathanp in forum Alpha Five Version 9 - Desktop Applications
    Replies: 10
    Last Post: 04-13-2009, 11:29 PM
  2. Named Connection string
    By urskumark in forum Application Server Version 9 - Web/Browser Applications
    Replies: 0
    Last Post: 11-11-2008, 07:08 AM
  3. Me and You and a dog named Lou !
    By G Gabriel in forum Alpha Five Version 6
    Replies: 4
    Last Post: 08-22-2005, 06:21 AM
  4. onrowdoubleclick and named browse
    By tcampb in forum Alpha Five Version 4
    Replies: 6
    Last Post: 03-03-2002, 10:30 AM
  5. How Many Named Days in a month
    By Michael Humby in forum Code Archive
    Replies: 3
    Last Post: 01-04-2002, 11:21 AM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •