?
Solved

Cold Fusion - dsn-less connection to SQL server database

Posted on 2004-03-22
7
Medium Priority
?
291 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
5 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

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Introduction This article explores the design of a cache system that can improve the performance of a web site or web application.  The assumption is that the web site has many more “read” operations than “write” operations (this is commonly the ca…
What You Need to Know when Searching for a Webhost Provider
In a question here at Experts Exchange (https://www.experts-exchange.com/questions/29062564/Adobe-acrobat-reader-DC.html), a member asked how to create a signature in Adobe Acrobat Reader DC (the free Reader product, not the paid, full Acrobat produ…
With just a little bit of  SQL and VBA, many doors open to cool things like synchronize a list box to display data relevant to other information on a form.  If you have never written code or looked at an SQL statement before, no problem! ...  give i…
Suggested Courses

864 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