• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

Data source problems

Explorer ,
Oct 24, 2012 Oct 24, 2012

Copy link to clipboard

Copied

Views

600

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Oct 24, 2012 Oct 24, 2012

Copy link to clipboard

Copied

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>

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Oct 26, 2012 Oct 26, 2012

Copy link to clipboard

Copied

LATEST

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

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Resources
Documentation