Wrox Programmer Forums
| Search | Today's Posts | Mark Forums Read
Classic ASP Basics For beginner programmers starting with "classic" ASP 3, pre-".NET." NOT for ASP.NET 1.0, 1.1, or 2.0
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Classic ASP Basics section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old June 11th, 2004, 11:34 AM
Friend of Wrox
 
Join Date: Aug 2003
Location: Halifax, Nova Scotia, Canada.
Posts: 166
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Here's the thing that I don't understand, whoever set up the website before me does not use the connection string like you guys us it, like the one above. All I see everywhere through the code are statments like this one:

SQLStr="SELECT * FROM Table"
Set RS=Server.CreateObject("ADODB.Recordset")
RS.Open SQLStr,Application("DBConn"),1,2,&H0001

So when you say connection string, ^^this is what I think of:(
So would there be a logical place where the database is connected to using the way you showed me? Or can the site be run by just using the above code? From what I understand, you would use the Connection string that you posted, on the top of every page that needs to connect to the database.

Thanks again for your help :)

-----------------------------------------------------------
"Don't follow someone who's not going anywhere" John Mason
 
Old June 11th, 2004, 12:29 PM
Imar's Avatar
Wrox Author
Points: 70,322, Level: 100
Points: 70,322, Level: 100 Points: 70,322, Level: 100 Points: 70,322, Level: 100
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jun 2003
Location: Utrecht, Netherlands.
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
Default

Your connection string is this:

Application("DBConn")

Somewhere (probably in the file called global.asa in the root of your site), the connection string is saved to an Application variable called DBConn. Look in the global.asa file, or search for Application("DBConn") and you'll find a connection string similar to the ones posted in this thread. However, you don't really need to do that; just use Application("DBConn") instead of YourConnectionStringHere I used earlier.

Re books: If you're using Dreamweaver to build site, look at Beginning Dreamweaver MX 2004. I am one of the authors so of course I am biased about this book, but I truly believe it will help you understand database driven ASP sites. Two of the three sample sites (TheSoccerSite and MediaEdge) are completely database driven web sites that show you how to use ASP and ADO to connect to Access databases, similar to the stuff you're doing now.
Beginning Active Server Pages is very good too, although I can't recall to what extend it discusses databases.
There used to be a book called ASP Databases, but I am not sure if it is still with Wrox and/or it is still a valid publication. Try Amazon for that.

Re ASP.NET: Hmmmm, it depends. Of course, ASP.NET is the future way to go. "Classic" ASP will be around for some time, but eventually, it will no longer be supported.
However, ASP.NET is a completely different beast. It depends a bit on the type of sites you're building and what you're using them for. Personally, I think it's a good idea to use classic ASP to learn basic Web things. Understand client-server, understand database interaction, understand the stateless nature of the Web, understand (basic) (X)HTML, JavaScript, CSS, stuff like that. Once you know how that works, the switch to ASP.NET is much easier.
ASP.NET has quite a learning curve, so if you try to learn it all at once, you may get into problems.....

Cheers,

Imar
---------------------------------------
Imar Spaanjaars
Everyone is unique, except for me.
 
Old June 11th, 2004, 12:40 PM
Friend of Wrox
 
Join Date: Aug 2003
Location: Halifax, Nova Scotia, Canada.
Posts: 166
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Thanks a lot Imar, I have checked out the Global.asa and it's all there. I actually am just keeping a few websites up-to-date and adding what's needed. It looks like they were designed using VisualInterDev, which I don't have access to so I have been doing all this work in Notepad. They will be getting me Macromedia Studio MX, so I will have to pick up your book so I can work with it that way.

Thanks for your help :)

-----------------------------------------------------------
"Don't follow someone who's not going anywhere" John Mason
 
Old June 11th, 2004, 01:07 PM
Imar's Avatar
Wrox Author
Points: 70,322, Level: 100
Points: 70,322, Level: 100 Points: 70,322, Level: 100 Points: 70,322, Level: 100
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jun 2003
Location: Utrecht, Netherlands.
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
Default

Quote:
quote:They will be getting me Macromedia Studio MX, so I will have to pick up your book so I can work with it that way.
That sounds like a great idea ;)

Visual Interdev creates a zillion lines of code for things that you can do yourself in only three or four lines. It does that to "shield you from complicated stuff like recordsets, connections, etc". However, in the end you'll end up with a big mess that is very hard to maintain by hand. Dreamweaver follows the same pattern, but less messy. You can also code ASP pages in Dreamweaver quite well without using their build-in Server Behaviors that create the code for you.

Good luck. Hope it's turning out well.

Imar
---------------------------------------
Imar Spaanjaars
Everyone is unique, except for me.




Similar Threads
Thread Thread Starter Forum Replies Last Post
Newsletter Mechanism vivek_inos ASP.NET 1.0 and 1.1 Professional 1 September 22nd, 2007 07:38 AM
Where is the newsletter option luisjeronimo BOOK: ASP.NET 2.0 Website Programming Problem Design Solution ISBN: 978-0-7645-8464-0 3 July 20th, 2007 03:16 PM
newsletter vantoko BOOK: ASP.NET 2.0 Website Programming Problem Design Solution ISBN: 978-0-7645-8464-0 2 February 28th, 2007 03:28 AM
Newsletter sydneyausguy BOOK: Professional DotNetNuke ASP.NET Portals ISBN: 0-7645-9563-6 1 August 19th, 2005 05:23 PM
help with newsletter question AStuntz Beginning PHP 1 May 13th, 2004 06:54 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.