Solved

Cold Fusion - dsn-less connection to SQL server database

Posted on 2004-03-22
7
280 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
7 Comments
 
LVL 17

Accepted Solution

by:
Tacobell777 earned 64 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 62 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 62 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 62 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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

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…
Article by: kevp75
Hey folks, 'bout time for me to come around with a little tip. Thanks to IIS 7.5 Extensions and Microsoft (well... really Windows 8, and IIS 8 I guess...), we can now prime our Application Pools, when IIS starts. Now, though it would be nice t…
Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.
With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …

930 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

Need Help in Real-Time?

Connect with top rated Experts

18 Experts available now in Live!

Get 1:1 Help Now