Copy link to clipboard
Copied
This question was posted in response to the following article: http://help.adobe.com/en_US/ColdFusion/10.0/Installing/WSc3ff6d0ea77859461172e0811cdec18ae0-7fed.htm...
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>
Copy link to clipboard
Copied
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