2 Replies Latest reply on Oct 26, 2012 7:20 AM by Kaif Akbar

    Data source problems

    community help Level 1
        • 1. Re:  Data source problems
          inkingston

          The original documentation has been incorrect since CF 8... Since 2007 and they keep rolling the incorrect documents forward to the next version.  5 years later...

           

          You need to create a new user in the CF Admin and assign the appropriate roles to the user to allow this to work.

          <cfscript>

          writeOutput("Installing ODBC Services...<br>");

          createObject("component","cfide.adminapi.administrator").login("password","username"); 

          myObj = createObject("component","cfide.adminapi.datasource");

          returnValue = myObj.installODBCservice();

          writeOutput("ODBC Services installed");

          </cfscript>

          • 2. Re:  Data source problems
            Kaif Akbar Level 1

            In such scenario, It is always better to first remove existing/corrupted odbc services through a .cfm page containing below code snippet(with admin user password):-

             

            <cfscript>

              //login using admin 

              //createObject("component","cfide.adminapi.administrator").login("administrator_password" );

              createObject("component","cfide.adminapi.administrator").login("password");      

              //instantiate datasource object

              myObj = createObject("component","cfide.adminapi.datasource");

            </cfscript>

             

            TO REMOVE ODBC SERVICES:

            <cfscript> 

                 writeOutput("Removing ODBC Services...<br>"); 

                 returnValue = myObj.removeODBCservice(); 

                 writeOutput("ODBC Services removed"); 

            </cfscript>

             

             

             

             

             

            Then install odbc services through a .cfm page containing below code snippet(with admin user password):-

             

            <cfscript>

              //login using admin 

              //createObject("component","cfide.adminapi.administrator").login("administrator_password" );

              createObject("component","cfide.adminapi.administrator").login("password");

              //instantiate datasource object

              myObj = createObject("component","cfide.adminapi.datasource");

            </cfscript>

             

            TO Install ODBC Services:

            <cfscript> 

                     writeOutput("Installing ODBC Services...<br>"); 

                     returnValue = myObj.installODBCservice(); 

                     writeOutput("ODBC Services installed"); 

            </cfscript>

             

             

             

            You can also put both scripts codes within single script tag for each purpose.

             

            Message was edited by: KaifAkbar