WebWeekly: Your weekly source for Web Technology Tips and Tricks! -Forward this email and subscription information to a fellow developer! ********************************************************************* !!! Impress your friends and loved ones !!! !!! Increase your self-esteem !!! !!! Meet beautiful, exotic women !!! *** To find out how, visit http://www.4GuysFromRolla.com/coolcrap/ *** ********************************************************************* ********************************************************************** So Just How Do you Connect to a Database? ********************************************************************** There are a number of ways to connect to a database. One way is to use a DSN-less connection. This is commonly done with Access databases, but can be done with SQL databases as well. The other popular method is to use a System DSN, which works for both Access and SQL databases as well. Many folks use Access databases, so they use DSN-less connections most often. Well, folks, there are some drawbacks to using DSN-less connections. First, though, let's talk about why you *would* want to use a DSN-less connection, and how to use a DSN-less connection when connecting to a SQL server (many folks, it seems, don't realize that you can have a DSN-less connection to a SQL box (the SQL database doesn't even have to reside on the same server that the web pages are being hosted on!)). Many web hosting companies like to make money; that's how they stay in business. To further their money-making efforts, they often charge to create a system DSN. I have had experiences with one web host that charged $30 to create a System DSN!! That's incredibly high considering that is takes a full thirty seconds to create a System DSN. (For those who are interested, thay're charging $3,600/hour.) So, there are a number of people who use a DSN-less connection to save a few bucks. I understand that, I am a poor college kid myself! Oh, by the way, here is how you can connect to a SQL server without using a System DSN: Dim objConn Set objConn = Server.CreateObject("ADODB.Connection") objConn.ConnectionString = "DRIVER=SQL Server;SERVER=(local);" & _ "UID=username;PWD=password;DATABASE=DBName" objConn.Open Where username is a valid User Name for the SQL database (and password a valid password for that username). I set SERVER=(local), meaning that the webserver and SQL server reside on the same machine. If this is not the case, you can replace the SERVER=(local) with SERVER=machinenameOfSQLServer. Lastly, DBName refers to the Database you want to connect to. Pretty straight forward. So, a DSN-less connection seems painless enough, plus it's free, so why gripe? Well, while it may cost no money, it will cost you performance, especially if you use Server.MapPath in your Access DSN-less connection (see http://www.activeserverpages.com/learn/dbopen.asp) MapPath is not very efficient, and bogs down IIS just a tad. If you have a number of simultaneous users, this could degrade performance noticeably. The best choice for maintainability and performance when dealing with database connectivity options is to use a System DSN. While it may cost you a few bucks in the long run, if you're site is a popular one, you're visitors will notice the difference and forever be in your gratitude. For some more information on connecting to databases, be sure to check out http://4guysfromrolla.com/webtech/042599-1.shtml. Happy Programming! ********************************************************************* ** More articles below, but first a word from our sponsor!!! :) ********************************************************************* ********************************************************************** Developers Can Now Deploy ASP Applications Anywhere! Halcyon Software will release this month an Active Server Framework that gives developers the ability to deploy Active Server Pages (ASP) applications on any Web Server, Application Server, or Operating System platform. Instant ASP (iASP) not only provides standard Microsoft ASP compatibility on non-Microsoft platforms, it extends basic ASP capabilities to provide support for Java, JavaServer Pages (JSP), and CORBA components as well. Instant ASP is $495 SRLP per deployment server. Developer editions of iASP are free! *** http://www.halcyonsoft.com *** -- Please support our sponsors, they make WebWeekly possible! -- ********************************************************************** ********************************************************************* ********************************************************************* OTHER ARTICLES ********************************************************************* How to Request and Install a SSL Certificate on IIS 4 http://www.4guysfromrolla.com/webtech/062299-1.shtml This article, by Ian Stallings, discusses what SSL is, and how to go about requesting an SSL certificate and setting it up on your IIS 4 webserver. ********************************************************************* Win a *FREE* Copy of ADSI CDO Programming with ASP http://4guysfromrolla.com/webtech/raffle/ We're giving away five free copies of Wrox's ADSI CDO Programming with ASP. The raffle's 100% free, so drop on by and sign up for your chance to win a copy of this great resource! (The raffle ends 6/27) ********************************************************************* Using @ENABLESESSIONSTATE http://www.4guysfromrolla.com/webtech/062099-1.shtml If you have .ASP pages that are *not* using session variables, then you should have @ENABLESESSIONSTATE set to False. If you don't, your page's performance is not as good as it could be. This article describes what @ENABLESESSIONSTATE is, and how to make sure you are using it correctly. ********************************************************************* More Commonly Asked Questions from the ASP Messageboard! http://4guysfromrolla.com/webtech/amb/ I've compiled a list of commonly asked database, beginner-level, and advanced ASP questions that frequently appear on the ASP MessageBoard. Since 80+% of the people have the same general questions, I figured that a compilation of common questions with answers would be helpful! Be sure to check it out!! ********************************************************************* Get all sorts of Cool Crap with the 4Guys Logo on it! http://4guysfromrolla.com/coolcrap/ If you've ever prayed that you could buy assorted merchandise with the 4GuysFromRolla.com logo plastered all over it, your prayers have been answered! Be sure to help support the sight and impress your friends by purchasing a 4GuysFromRolla.com coffee mug! ********************************************************************* 4GuysFromRolla.com Humor Section http://www.4GuysFromRolla.com/humor The humor section has been consistently growing, and we recently won an award for it! I know this is a little off-topic for the WebWeekly, so I don't want to go into it; just wanted to invite you all to check out our collection of jokes, original humor, and spoof sites! ********************************************************************* I hope you enjoyed this WebWeekly. If you have any ideas, comments, suggestions, rants, or raves, please let me know by replying to this email. If you are not familiar with 4GuysFromRolla.com, be sure to check out http://www.4GuysFromRolla.com/new, to view our sitemap. Happy Programming! ********************************************************************* ********************************************************************* To subscribe to WebWeekly, point your browser to: http://www.4GuysFromRolla.com/webtech/webdaily To unsubscribe from WebWeekly, reply to this email with the following subject: UNSUBSCRIBE WEBWEEKLY ********************************************************************* ********************************************************************* Thank you for subscribing to WebWeekly! If you know someone who could benefit from a wealth of web development technology, invite them to visit http://www.4GuysFromRolla.com/new