?
Solved

Cold Fusion - dsn-less connection to SQL server database

Posted on 2004-03-22
7
Medium Priority
?
287 Views
Last Modified: 2013-12-24
is there a way of using a DSN-less connection with Cold Fusion MX to connect to a SQL database (located on a different server to CF)? I have seen the following code around, but it doesn't seem to work for CF MX...just generates an error that CONNECTSTRING is not supported.

<cfset Connection = "Provider=SQLOLEDB.1;Persist Security Info=False;User ID=XXX;Password=XX;Initial Catalog=XXX;Data Source=IP ADDRESS;Network Library=DBMSSOCN">
<CFQUERY NAME="Test" DBTYPE="dynamic" CONNECTSTRING="#Connection#">
SELECT * from SomeTable
</CFQUERY>
0
Comment
Question by:garthdonovan
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
7 Comments
 
LVL 17

Accepted Solution

by:
Tacobell777 earned 256 total points
ID: 10654897
Its not supported anymore in CFMX, I think (not sure) that if you want a DSNless connection you need to use ADO..
0
 
LVL 17

Assisted Solution

by:anandkp
anandkp earned 248 total points
ID: 10655586
Use CF Native drivers [CFADMIN] to create DSN - they r much efficient & faster !

as rightly said above - DSNLess connections are not supported ne-more in CFMX !
0
 
LVL 35

Assisted Solution

by:mrichmon
mrichmon earned 248 total points
ID: 10658789
It is safer anyway not to use a DSNless connection as your example, because if someone gets your page code they get your security information and can hack your server.

That is one of the reasons that they moved away from DSNless connections
0
 
LVL 5

Assisted Solution

by:Seth_Bienek
Seth_Bienek earned 248 total points
ID: 10717927
Just to reiterate what Tacobell777 said, CFMX does not support DSNless connections.

That's the bad news.

The good news is that CFMX does use JDBC for database functionality, which means you can extend java classes directly to do your database stuff.

Dan Plesse has a library of code he developed just for this purpose, that lets you "add, update or delete data from any database from any location", aka, DSNless connections.

I have to stress to you that I have not used any of his code, nor looked at it personally.  But it might work for you, or at least give you some ideas for an approach of your own.

Let us know how it works out!

Take Care,

Seth
0
 
LVL 5

Expert Comment

by:Seth_Bienek
ID: 10717931
0

Featured Post

Enterprise Mobility and BYOD For Dummies

Like “For Dummies” books, you can read this in whatever order you choose and learn about mobility and BYOD; and how to put a competitive mobile infrastructure in place. Developed for SMBs and large enterprises alike, you will find helpful use cases, planning, and implementation.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

A web service (http://en.wikipedia.org/wiki/Web_service) is a software related technology that facilitates machine-to-machine interaction over a network. This article helps beginners in creating and consuming a web service using the ColdFusion Ma…
What You Need to Know when Searching for a Webhost Provider
Add bar graphs to Access queries using Unicode block characters. Graphs appear on every record in the color you want. Give life to numbers. Hopes this gives you ideas on visualizing your data in new ways ~ Create a calculated field in a query: …
This tutorial will teach you the special effect of super speed similar to the fictional character Wally West aka "The Flash" After Shake : http://www.videocopilot.net/presets/after_shake/ All lightning effects with instructions : http://www.mediaf…
Suggested Courses
Course of the Month13 days, 20 hours left to enroll

800 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question