14 Replies Latest reply on Apr 22, 2014 4:57 AM by tribule

    Access denied on a datasource

    plarts Level 1

      A big problem, I cannot anymore use my new CF datasource.

       

      I use to declare CF datasource on a C F9 64bits , Windows serveur 2008 64bits environment.

      I have around 80 datasources declared (Access mdb files).

       

      I use the same procedure to create my datasource.

      create the ODBC32 datasource.

      Then create the CF datasource linked to the created ODBC datasource.

      As I always do.

      When I verify the datasource in the CF admin, it says OK. all seems good

       

      And when I do a query to that datasource,

      I have this message :

      Security: The requested template has been denied access to allergan_prof_sante.

      The following is the internal exception message: access denied (coldfusion.sql.DataSourcePermission allergan_prof_sante)

       

      I tried to create an other datasource.

      Same behaviour. OK in the CF admin.

      And "access denied" when doing a query.

       

      So now, any datasource created cannot be accessed.

      I did not change anything on the Windows server

       

      The only change, is my client PC which ftp the mdb file.

      It was Vista, and is now windows 7.

       

      Any urgent help is welcome. I cannot anymore use new datasource.

      All old datasource are working correctly.

       

      I looked at the mdb files properties, old and new , they have the same.

      Thanks for help.

        • 1. Re: Access denied on a datasource
          Carl Von Stetten Adobe Community Professional & MVP

          plarts,

           

          Have you checked that the user account ColdFusion is running under actually has permissions to read/write the .mdb files in question?

           

          -Carl V.

          • 2. Re: Access denied on a datasource
            plarts Level 1

            What is surprising, is that the mdb file (or any new mdb files I put) is in a

            directory I use for other datasources already declared. (declared before).

            Why now, CF would not access the new files, and is accessing the old files.

            In the windows services , CF 9 applications erver, in properties,

            I have the CF user account as : local system account

            It has never been changed.

            How can I check the read/write permission of this user (which is admin, I suppose)

            This is on production server,

            Could a reboot help ?

            thanks for help.

            • 3. Re: Access denied on a datasource
              Carl Von Stetten Adobe Community Professional & MVP

              plarts,

               

              I wasn't saying that was definitely the problem.  The issue with permissions is one of the most common reasons an Access database connection fails.  I just wanted to rule it out.  I would still compare the file-level permissions on one of the working databases with one that doesn't work to see if there is anything different.

               

              Another thing to check: If you open the ODBC Data Sources applet (the one for the 32-bit subsystem - I think you have to manually navigate to it at \Windows\SysWOW64\odbcad32.exe), check if you can successfully test the datasource for one of the databases not currently working.  This will rule out an ODBC configuration problem.

               

              -Carl V.

              • 4. Re: Access denied on a datasource
                plarts Level 1

                Thanks,

                How to check the file-level permission of the old and new mdb files ?

                I do not know how to check this.

                 

                Also, how to check the ODBC datasource ?

                When ckecked under CFadmin, it does gives the OK. (CF datasource)

                the one not cuurently working, which gives the access denied.

                (For ODBC, yes, I run the  Windows\SysWOW64\odbcad32.exe)

                 

                An other interesting indication,

                I used a old CF datasource, I just place a new mdb file and rename with the

                declared name in the old datasource, and then it works.

                Which means, I can use all existing datasource, with new mdb file in it.

                 

                Pierre.

                • 5. Re: Access denied on a datasource
                  Carl Von Stetten Adobe Community Professional & MVP

                  For the first question, right click on the .mdb file in Explorer and select Properties.  Go to the Security tab and look at the permissions granted to SYSTEM and any other users.

                   

                  For the second question, you need to run Windows\SysWOW64\odbcad32.exe.  Select the database connection in question and go through the configuration steps (probably without making changes).  On one of the screens it should have a button to test the connection.  Do that and see what happens.

                   

                  -Carl V.

                  • 6. Re: Access denied on a datasource
                    plarts Level 1

                    I looked at mdb properties, permissions for system, thay have all,

                    and same grant than other (old) mdb files.

                     

                    In the odbcad32.exe , there is no "test" button.

                    Only : select , create, repair, compact

                    And advanced, and options.

                    No test button in any.

                     

                    What you think of in the previous reply :

                     

                    An other interesting indication,

                    I used a old CF datasource, I just place a new mdb file and rename with the

                    declared name in the old datasource, and then it works.

                    Which means, I can use all existing datasource, with new mdb file in it.

                    • 7. Re: Access denied on a datasource
                      Carl Von Stetten Adobe Community Professional & MVP

                      Oops, you are correct.  I confused the Access ODBC settings with the SQL Server ones (which allow you to test).  My only other thought is to use Access or Excel to connect to the ODBC datasource and see if it can read it.

                       

                      Just so you know, many people have fought with getting 64-bit ColdFusion to talk to MS Access - and most give up because it is so painful.  There have been several posts on the Adobe forums in the past that you might look at for further ideas, but generally it is not recommended to do this.  You'd be better off using a 32-bit ColdFusion install if you must deal with Access databases.  However, I'll repeat my recommendation from a previous thread of yours - don't use Access at all in ColdFusion.

                       

                      If you are trying to use ColdFusion simply as an automation tool for manipulating Access data, I would just look for ways to do those manipulations from within MS Access (either through a series of queries and macros, or if you really want to dig in, with the built-in VBA).

                       

                      -Carl V.

                      • 8. Re: Access denied on a datasource
                        plarts Level 1

                        I really need to find a solution,

                        I have 64bits server then CF 64bits,

                        so I cannot get back to 32bits.

                        Or build a new machine, with all. (need to rebuy all).

                         

                        Also, I have all my systems and webs set with mdb files.

                        Even for single user, I use CF, because is easier for me to develop under CF.

                         

                        Any othe ridea, why suddenly, the new CF Datasource have "access denied" ?

                        (all previous working, in same directory).

                         

                        Thanks for any help.

                        Pierre.

                        • 9. Re: Access denied on a datasource
                          Carl Von Stetten Adobe Community Professional & MVP

                          You can install and run 32-bit ColdFusion on a 64-bit Windows server, so don't worry about that.

                           

                          The only other thing I can think of is that the databases might be password-protected or have additional user security added.  If you double-click on one of the problem MDB files in Explorer, does it open right up or does it prompt you for a login/password?  If it doesn't, do you have the credentials in the ColdFusion datasource set to use "Admin" for the username and a blank password?

                           

                          If that isn't your problem, then I'm out of ideas at this point.

                           

                          Good luck,

                          -Carl V.

                          • 10. Re: Access denied on a datasource
                            plarts Level 1

                            Well, no there is no password.

                            Then I need to understand what have changed.

                            This did work and does not work anymore,

                            could it be an automated Windows update ?

                            Is the number of declared datasource limited (I have 68 declared) ?

                            Pierre.

                            • 11. Re: Access denied on a datasource
                              Carl Von Stetten Adobe Community Professional & MVP

                              If the *exact* same databases worked previously, then something else must be at play here.  Could a Windows update have broken things?  It's possible, although if that were the case I'd expect all of the datasources to be broken.  I'm not aware of any limits to the number of datasources allowed in ColdFusion.

                               

                              Just to be clear, have you tried to open the MDB files in question in the MS Access program?  Have you run "compact and repair" on them to see if there is some corruption in those particular files?

                               

                              -Carl V.

                              • 12. Re: Access denied on a datasource
                                tribule Level 2

                                Long shot: check the case of the DSN. Is it the same case in the CF Admin and in the code? I've had that issue before with Access DSNs, even on Windows (which should not be case sensitive.) Do you also have sandbox security enabled? If so, check the options in the CF Admin to make sure the DSN is not being blocked.

                                • 13. Re: Access denied on a datasource
                                  plarts Level 1

                                  Thanks all,

                                  I checked DSN name in odbc32, CFadmin, code, I put the same every where.

                                  Same behaviour. (and always successfull in CFadmin)

                                   

                                  BUT GREAT : sandbox security problem , really great , full of thanks ...

                                  So now, when creating a new datasource, it is put automatically is "disabled" datasource.

                                  I just have to reenable them.

                                  Why this have changed ??? only god knows ?

                                  Or may be "sandbox security was not checked some time ago, and I did it,

                                  not thinking that new datasource will be disabled.

                                  Many thanks again, I was so lost and down.

                                   

                                  Pierre.

                                  • 14. Re: Access denied on a datasource
                                    tribule Level 2

                                    Glad to have helped, the security in CF has been upgraded over time, hence the new defaults.