Unable to create odbc socket connection programmatically in Coldfusion 16.

New Here ,
Jan 15, 2018 Jan 15, 2018

Copy link to clipboard

Copied

I have tried the 2 methods to create an odbc socket from coldfusion code. but i am getting the below error. Please advise.

---------------------------------------------------------------------------------------------------------------------

The error occurred in setdsn.cfm: line 13
Called from setdsn.cfm: line 9
Called from setdsn.cfm: line 1
Called from datasource.cfc: line 888
Called from C:/inetpub/wwwroot/mark_test.cfm: line 25
-1 : Unable to display error's location in a CFML template. 

Resources:
Browser  Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 6.1; WOW64; Trident/4.0; SLCC2; .NET CLR 2.0.50727; .NET CLR 3.5.30729; .NET CLR 3.0.30729)
Remote Address  ::1
Referrer 
Date/Time  15-Jan-18 04:58 PM
at cfsetdsn2ecfm1392533896._factor0(/CFIDE/adminapi/_datasource/setdsn.cfm:13) at cfsetdsn2ecfm1392533896._factor17(/CFIDE/adminapi/_datasource/setdsn.cfm:9) at cfsetdsn2ecfm1392533896.runPage(/CFIDE/adminapi/_datasource/setdsn.cfm:1) at cfdatasource2ecfc268763035$funcSETODBCSOCKET.runFunction(/CFIDE/adminapi/datasource.cfc:888) at cfmark_test2ecfm1016587668.runPage(C:/inetpub/wwwroot/mark_test.cfm:25)

coldfusion.security.SecurityManager$UnauthenticatedCredentialsException at coldfusion.security.SecurityManager.authenticateAdmin(SecurityManager.java:2569) at coldfusion.sql.Executive.getDatasources(Executive.java:144) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:498) at coldfusion.runtime.StructBean.resolveName(StructBean.java:187) at coldfusion.runtime.Scope.get(Scope.java:60) at coldfusion.runtime.DotResolver.resolve(DotResolver.java:45) at coldfusion.runtime.DotResolver.resolve(DotResolver.java:72) at coldfusion.runtime.DotResolver.resolveSplitNameInMap(DotResolver.java:124) at coldfusion.runtime.CfJspPage._resolve(CfJspPage.java:2028) at coldfusion.runtime.CfJspPage._resolveAndAutoscalarize(CfJspPage.java:2348) at coldfusion.runtime.CfJspPage._resolveAndAutoscalarize(CfJspPage.java:2338) at coldfusion.runtime.CfJspPage._resolveAndAutoscalarize(CfJspPage.java:2318) at cfsetdsn2ecfm1392533896._factor0(/CFIDE/adminapi/_datasource/setdsn.cfm:13) at cfsetdsn2ecfm1392533896._factor17(/CFIDE/adminapi/_datasource/setdsn.cfm:9) at cfsetdsn2ecfm1392533896.runPage(/CFIDE/adminapi/_datasource/setdsn.cfm:1) at coldfusion.runtime.CfJspPage.invoke(CfJspPage.java:253) at coldfusion.tagext.lang.IncludeTag.handlePageInvoke(IncludeTag.java:737) at coldfusion.tagext.lang.IncludeTag.doStartTag(IncludeTag.java:573) at coldfusion.runtime.CfJspPage._emptyTcfTag(CfJspPage.java:3696) at cfdatasource2ecfc268763035$funcSETODBCSOCKET.runFunction(/CFIDE/adminapi/datasource.cfc:888) at coldfusion.runtime.UDFMethod.invoke(UDFMethod.java:492) at coldfusion.runtime.UDFMethod$ReturnTypeFilter.invoke(UDFMethod.java:425) at coldfusion.runtime.UDFMethod$ArgumentCollectionFilter.invoke(UDFMethod.java:388) at coldfusion.filter.FunctionAccessFilter.invoke(FunctionAccessFilter.java:95) at coldfusion.runtime.UDFMethod.runFilterChain(UDFMethod.java:339) at coldfusion.runtime.UDFMethod.invoke(UDFMethod.java:538) at coldfusion.runtime.TemplateProxy.invoke(TemplateProxy.java:655) at coldfusion.runtime.TemplateProxy.invoke(TemplateProxy.java:464) at coldfusion.runtime.CfJspPage._invoke(CfJspPage.java:3019) at coldfusion.runtime.CfJspPage._invoke(CfJspPage.java:2994) at cfmark_test2ecfm1016587668.runPage(C:\inetpub\wwwroot\mark_test.cfm:25) at coldfusion.runtime.CfJspPage.invoke(CfJspPage.java:253) at coldfusion.tagext.lang.IncludeTag.handlePageInvoke(IncludeTag.java:737) at coldfusion.tagext.lang.IncludeTag.doStartTag(IncludeTag.java:573) at coldfusion.filter.CfincludeFilter.invoke(CfincludeFilter.java:65) at coldfusion.filter.IpFilter.invoke(IpFilter.java:45) at coldfusion.filter.ApplicationFilter.invoke(ApplicationFilter.java:505) at coldfusion.filter.RequestMonitorFilter.invoke(RequestMonitorFilter.java:43) at coldfusion.filter.MonitoringFilter.invoke(MonitoringFilter.java:40) at coldfusion.filter.PathFilter.invoke(PathFilter.java:153) at coldfusion.filter.LicenseFilter.invoke(LicenseFilter.java:30) at coldfusion.filter.ExceptionFilter.invoke(ExceptionFilter.java:94) at coldfusion.filter.BrowserDebugFilter.invoke(BrowserDebugFilter.java:78) at coldfusion.filter.ClientScopePersistenceFilter.invoke(ClientScopePersistenceFilter.java:28) at coldfusion.filter.BrowserFilter.invoke(BrowserFilter.java:38) at coldfusion.filter.NoCacheFilter.invoke(NoCacheFilter.java:60) at coldfusion.filter.GlobalsFilter.invoke(GlobalsFilter.java:38) at coldfusion.filter.DatasourceFilter.invoke(DatasourceFilter.java:22) at coldfusion.filter.CachingFilter.invoke(CachingFilter.java:62) at coldfusion.CfmServlet.service(CfmServlet.java:219) at coldfusion.bootstrap.BootstrapServlet.service(BootstrapServlet.java:89) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:230) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:165) at coldfusion.monitor.event.MonitoringServletFilter.doFilter(MonitoringServletFilter.java:42) at coldfusion.bootstrap.BootstrapFilter.doFilter(BootstrapFilter.java:46) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:192) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:165) at coldfusion.inspect.weinre.MobileDeviceDomInspectionFilter.doFilter(MobileDeviceDomInspectionFilter.java:121) at coldfusion.bootstrap.BootstrapFilter.doFilter(BootstrapFilter.java:46) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:192) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:165) at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:192) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:165) at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:199) at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:96) at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:474) at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:140) at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:79) at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:87) at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:363) at org.apache.coyote.ajp.AjpProcessor.service(AjpProcessor.java:507) at org.apache.coyote.AbstractProcessorLight.process(AbstractProcessorLight.java:66) at org.apache.coyote.AbstractProtocol$ConnectionHandler.process(AbstractProtocol.java:798) at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1434) at org.apache.tomcat.util.net.SocketProcessorBase.run(SocketProcessorBase.java:49) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61) at java.lang.Thread.run(Thread.java:745) 

-----------------------------------------------------------------------------------------------------------------------

<cfset adm =createObject("component", "cfide.adminapi.administrator")>

<cfset isLoggedIn= adm.login("test_test","admin")>

<cfscript>

// Instantiate the data source object.

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

dsn = {

name = "test_test",

datasource = "test_test",

username = "",

password = ""

};

//Create a DSN.

myObjR.setODBCSocket(argumentCollection=dsn);

</cfscript>

or

<cfset adm =createObject("component", "cfide.adminapi.administrator")>

<cfset isLoggedIn= adm.login("test_test","admin")>

<cfscript>

// Instantiate the data source object.

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

stDSNR = structNew();

stDSNR.name="test_test";

stDSNR.datasource = "test_test"; 

stDSNR.username = "";

stDSNR.password = "";

//Create a DSN.

myObjR.setODBCSocket(argumentCollection=stDSNR);

</cfscript>

Views

269

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
community guidelines
Adobe Community Professional ,
Jan 15, 2018 Jan 15, 2018

Copy link to clipboard

Copied

LATEST

Is this 64-bit Windows and 64-bit CF 2016? If so, I have not found that to be able to work with ODBC (including MS Access, which was formerly listed separately as a datasource type in CF).

And I will note that even though you still see both Access and ODBC as datasource types in the CF Admin (and can add them via the Admin API, as you are showing), the CF2016 "System Requirements" page , which also lists supported databases, does NOT list ODBC or Access: https://helpx.adobe.com/pdf/coldfusion2016-support-matrix.pdf


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