Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Direct Database Access Possible?

Status
Not open for further replies.

MrSki

Programmer
Dec 13, 2000
66
US
An interesting question was posed to me by a friend who has his web site on a server that supports Cold Fusion. He was wanting to know if there is a way in CF to access a database without having a DSN set. He is not sure if the people running the server will set up DSNs for a database he uploads and he is currently using VBScript for direct access to the database.

Can it be done?

Mitch Duszynski
Web Developer
Human Kinetics
PO Box 5076, Champaign, IL 61825
Tel: 217-351-5076 x2474 | Fax: 217-351-2674
mitchd@hkusa.com |
 
You can only do this with ColdFusion if you are using version 5.0. DSNless connections were introduced in that release. CFMX does not have this functionality and neither do versions prior to 5.0. The CONNECTSTRING attribute of cfquery in CF 5.0 allows you to connect to a database file.

-Tek
 
Supporting cold fusion and not settign up dsns is suicide for a commercial host. most allow you to set up your own dsn through a web based control panel. but this must be a different situation.

 
After more exploring my friend found that his host did indeed set up DSNs so the problem is resolved.

Thanks!



Mitch Duszynski
Web Developer
Human Kinetics
PO Box 5076, Champaign, IL 61825
Tel: 217-351-5076 x2474 | Fax: 217-351-2674
mitchd@hkusa.com |
 
Supporting cold fusion and not settign up dsns is suicide for a commercial host

Suicide?? How so?


-Carl
 
its a really dumb move business wise. there are a LOT of people out there that are only learnign CF, and would go other places.

 
Carl,

I think he means it's suicide because not allowing the use of datasources for CF sites negates a lot of the functionality that CF is useful for, namely database driven applications. Since using a connectstring only works in CF 5.0, and connecting this way is useless when it comes to scalability, I can see the point.

However it is all moot since the ISP DOES setup DSNs for the customer! :)

-Tek
 
Ahhh... I get it. Yes, not offering DSN's would be bad if you were a commercial ColdFusion host.

It certainly isn't suicide to use DSN-less connections, as a developer, though, if you know how (and you're using CF 5.0, of course). I guess that's where I thought imstillatwork was going.

It's a myth that DSN's are faster than direct connections (in fact, it's usually the opposite), or that DSN-less connections are somehow not scalable (in fact, they can handle a lot more concurrent connections than a System DSN, at least under Windows).

Check out


-Carl
 
That's quite an old article. As far as my point about scalability, there are lots of things not taken into consideration:

This was tested against an Access database. How many enterprise applications with high load use Access or another desktop database? How many do you think connect via DSN-less connections? In my experience, none that I've seen.

How does one use data replication features? What if 10 servers need to connect through the network to one single database file? What happens when an application needs failover? Desktop databases such as Access do not support these high-level features.

If a DSN-less connection is faster on my dev machine, it's not much faster than a DSN connection, and does it really matter if only a handful of users are hitting the database, anyway?

Another thing is that in CF versions prior to MX, I always used ODBC (connecting to SQL Server 7/2000). I ran some benchmarks using OLEDB, and the performance in most cases was below ODBC performance. Also, OLEDB had problems with dates, and generally ran a lot more buggy than ODBC. At any rate, I NEVER read an article that proved OLEDB was better or faster, but I saw it mentioned a few times, sans any credible benchmarks. All I know about OLEDB vs. ODBC is that ODBC performed better with my applications, so I stuck with it.

Now, with CFMX, it's the gool 'ol JDBC SQL Server driver.

:)

-Tek
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top