Highlighted

ColdFusion 11 ODBC service

New Here ,
Jun 24, 2014

Copy link to clipboard

Copied

People who installed coldFusion 11 on our server didn't select the option "ODBC Service".

Is there a way to install the ODBC service without re-installing coldFusion ?

Views

2.4K

Likes

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

ColdFusion 11 ODBC service

New Here ,
Jun 24, 2014

Copy link to clipboard

Copied

People who installed coldFusion 11 on our server didn't select the option "ODBC Service".

Is there a way to install the ODBC service without re-installing coldFusion ?

Views

2.4K

Likes

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
Jun 24, 2014 0
Enthusiast ,
Jun 24, 2014

Copy link to clipboard

Copied

Hi

Here are the steps you need to follow .

  1. Navigate to adminconfig.xml at C:\ColdFusion11\cfusion\lib\ and open it with text editor (say notepad).
  2. Change the value from “false” to “true” in <runmigrationwizard>false</runmigrationwizard> and <odbc>false</odbc>.
  3. Change the value from “false” to “true” <odbc>false</odbc>.
  4. Save the file and restart ColdFusion Service.
  5. After restarting the service, you will get the migration wizard. Follow the onscreen wizard to continue.

HTH

Thanks

VJ

Likes

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
Reply
Loading...
Jun 24, 2014 0
New Here ,
Jun 24, 2014

Copy link to clipboard

Copied

Thank you, but it didn't work.

Now I have the message "The ColdFusion ODBC Server service is not running or has not been installed. You may also use the "MS Access with Unicode" driver to connect to MS Access datasources."

but there isn't any "MS Access with Unicode" in the list of drivers.

Dominique

Likes

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
Reply
Loading...
Jun 24, 2014 0
Enthusiast ,
Jun 24, 2014

Copy link to clipboard

Copied

If there is ColdFusion 11 ODBC Agent and ColdFusion 11 ODBC Server services created then delete them via command prompt

Then use this script to delete the corrupted ODBC services. Run these cfm from CF 11 and then check the services.

Remove_ODBC.cfm

<cfscript>

  //login using admin 

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

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

  //instantiate datasource object

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

</cfscript>

 

NOW TO REMOVE ODBC SERVICES:

<cfscript> 

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

     returnValue = myObj.removeODBCservice(); 

     writeOutput("ODBC Services removed"); 

</cfscript>

Install_ODBC.cfm

<cfscript>

  //login using admin 

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

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

  //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>

HTH

Thanks
VJ

Likes

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
Reply
Loading...
Jun 24, 2014 0
New Here ,
Jun 24, 2014

Copy link to clipboard

Copied

It didn't work...

The message is "Error".

Likes

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
Reply
Loading...
Jun 24, 2014 0
Enthusiast ,
Jun 24, 2014

Copy link to clipboard

Copied

I tried the same before posting and is working for me. There might be something wrong at your end.

You can re-install CF 11 then. If CF 11 is developer/enterprise, then you will be able to create the car/archive file.

Likes

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
Reply
Loading...
Jun 24, 2014 0
New Here ,
Oct 14, 2014

Copy link to clipboard

Copied

check the script

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

admin password

Likes

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
Reply
Loading...
Oct 14, 2014 0
Oct 15, 2014

Copy link to clipboard

Copied

Actually same above code won't work, you would need to use your CF server admin password then it would be authentication properly and would execute that script flawless.

Likes

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
Reply
Loading...
Oct 15, 2014 0
Adobe Community Professional ,
Dec 29, 2017

Copy link to clipboard

Copied

I know this is an old thread, but I was needing to do for a client what is discussed here. I see the challenges that Dom had, and though they have likely moved on from the challenge, I offer the following in case anyone else tries what was offered and also gets also the "error" Domi reported.

1) Note first while all Domi reports is seeing "error", that would suggest that something is hiding the details of the error. There can be different reasons for that.

a) But you may find that whatever underlying error it was, it should be logged in the CF logs (especially the application.log).

b) If not, then it would suggest there is some sort of error handler in place (handling the error and hiding the details from users), and sadly most error handling code doesn't go so far as to also write the error to CF's logs, with CFLOG (that's a subject for another day).

2) But as for what the "error" could be, ...

a) Note next that the code offered by Vishu started by trying to delete any existing odbc services. One might wonder, if those don't exist, whether that itself cause an error. It would not. I tested that.

b) Instead, look closely at the code. For some reason, Vishu offers two lines in a row doing the login. The first, where he leaves a place to fill in "administrator_password", is actually COMMENTED OUT. You want to uncomment that, and frankly just delete the next one (that tries to login with a password of "admin").

BTW, note that this code (doing the login by passing in only the password) presumes that the CF admin username is indeed "admin". If it is not, then you need to actually pass in that other username as a second argument in the login method. I will leave that as an exercise for interested readers.

c) And then notice that he repeats that code for both files he offers, so you'd need to do that in each.

With the correct CF admin password, and the login not commented out (and the next login after it removed), then this should indeed work to create the ODBC services. And note that it does it immediately and starts them (which may take a moment). You should then be able to proceed to try to add a datasource using ODBC.

As for whether one should be doing ODBC DSNs in 2017, that is yet another question, for another day. 🙂

/Charlie (server troubleshooter, carehart.org)

Likes

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
Reply
Loading...
Dec 29, 2017 1
Adobe Community Professional ,
Dec 29, 2017

Copy link to clipboard

Copied

Oh, and one more gotcha about this (which could have been Domi's "error"), or may bite others who come across this thread in the future: if you have the Windows CF service set to run as some user other than the default of "local system", then you will get an error:

"Unable to set value HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\ColdFusion 2016 ODBC Server\Description: Windows error number 0 occurred.The handle is invalid."

The problem is that CF (running this code) is trying to add this key to the registry, but it cannot (because by default, the cf user one would create to have as the Windows service user for CF) would NOT have permissions to anything in the registry (other than its own user-specific keys).

So you could go into regedit and go to the top-level services key (HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\), and give that user full permissions, and THEN the code should run ok. (I hit this on a client machine, and this was the quick solution. Just thought I'd share it with others here.)

But note that you should NOT leave that permission set, because a bad guy running CF code could cause creation of services as well. Once you confirm that the code above creates the service, just remove that permission. And doing so will NOT remove any lower-level permissions you may have given to the CF service (something that has value, for other reasons).

Hope that makes sense to those who are interested in this subject. 🙂

/Charlie (server troubleshooter, carehart.org)

Likes

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
Reply
Loading...
Dec 29, 2017 0