Wrox Programmer Forums

Need to download code?

View our list of code downloads.

| FAQ | Members List | Calendar | 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 tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Reply
 
Thread Tools Search this Thread Display Modes
  #11 (permalink)  
Old July 2nd, 2008, 06:32 PM
Friend of Wrox
 
Join Date: Jun 2008
Location: Snohomish, WA, USA
Posts: 1,649
Thanks: 3
Thanked 141 Times in 140 Posts
Default

I guess I'm just too young and ambitious. I want to go for the latest stuff. (Now learning Tapestry 5 for Java. Like ASP.NET without any possibility of just slapping code into the HTML page. Easier to build custom controls than .NET, which is a good thing, because there sure aren't many standard controls. Not sure I like it, yet.)

My current age is a number that is the product of three prime numbers (no, 1 is not a prime number), two of which are the same.

In a couple of months, my age will be a number that has only one prime factor.

Go ahead. Figure it out. <grin/>
Reply With Quote
  #12 (permalink)  
Old July 2nd, 2008, 06:43 PM
Friend of Wrox
Points: 6,664, Level: 34
Points: 6,664, Level: 34 Points: 6,664, Level: 34 Points: 6,664, Level: 34
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jan 2004
Location: Sydney, NSW, Australia.
Posts: 1,870
Thanks: 12
Thanked 20 Times in 20 Posts
Send a message via AIM to mat41
Default

lol like your post. Sorry to those who feel this of-topic slant is a waste of bits and bytes.....anyhow; if it bothers stop reading and get back to work :o)

Wind is your friend
Matt
www.elitemarquees.com.au
Reply With Quote
  #13 (permalink)  
Old July 3rd, 2008, 04:30 AM
Imar's Avatar
Wrox Author
Points: 72,055, Level: 100
Points: 72,055, Level: 100 Points: 72,055, Level: 100 Points: 72,055, Level: 100
Activity: 100%
Activity: 100% Activity: 100% Activity: 100%
 
Join Date: Jun 2003
Location: Utrecht, Netherlands.
Posts: 17,086
Thanks: 80
Thanked 1,587 Times in 1,563 Posts
Default

Quote:
quote:Anyhow over the years I have learnt alot from this forum, especially Imar (who I call Mr ASP).
Even Mr ASP - also not so young anymore - made the move to ASP.NET a long time ago.

Granted, at the company where I work we still need to support classic ASP as well as we have a bunch of old ASP applications. It's difficult to find people who can code ASP well (just as it's difficult now to find good .NET people). Part of the problem is of course that the ASP sites are mainly maintenance sites; no new cool stuff or Web 2.0 type of sites to develop. I don't think we built something new in classic ASP for the past three or four years and I don't see it happen in the future anymore.

Imar


---------------------------------------
Imar Spaanjaars
http://Imar.Spaanjaars.Com
Everyone is unique, except for me.
Author of Beginning ASP.NET 3.5 : in C# and VB, ASP.NET 2.0 Instant Results and Dreamweaver MX 2004
Want to be my colleague? Then check out this post.
Reply With Quote
  #14 (permalink)  
Old July 3rd, 2008, 11:32 AM
Authorized User
 
Join Date: Jul 2008
Location: Deneysville, Free State, South Africa.
Posts: 12
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Hi Old Pedant,

Thank you for the new code. I have inserted and tested the new code. The first part for user works perfectly. How ever, the part for admin does not display all records, but instead it retains the userID, and as a result once to display the records for the admin user ID.

I checked this by doing a response.write for SQL. In this statement it displays the user ID of the admin.

I have spent most of the day searching Google to try and understand your coding and getting the grasp of the syntax. A good learning curve, but not yet perfected.

Yes I can confirm that the response.write to check the access level is correct for the previous set of coding.

Hopefully this feedback might assist in tracing the breakdown for admin.

Thank you

Reply With Quote
  #15 (permalink)  
Old July 3rd, 2008, 01:28 PM
Authorized User
 
Join Date: Jul 2008
Location: Deneysville, Free State, South Africa.
Posts: 12
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Hi Imar,

Thank you for your posting.

I have inserted your response.write code. I get the following error:

Error Type:
Microsoft VBScript compilation (0x800A0401)
Expected end of statement
/glenvistaCS3_web/News_Results.asp, line 59, column 61
Response.Write("Value is """ & session("AccessLevel")) & """")
------------------------------------------------------------^
I am still learning the syntax. I understand "value is " is a text string. The next two "" I don't understand. & is joining (concatenation) session access level variable. Another &, but the last 4 ", I do not understand. Kindly explain.

Yes I did insert the response.write be for the case block.

I am busy having a look at the PDF chapter sample of your book. I enjoyed reading " smart controls made it possible to reduce the code required to build an application, decreasing the learning curve for new developers and increasing the productivity. " I believe that this is really going to help me as I am not too good with coding. I have for some time been considering the move to ASP.net. I have just upgraded to the Adobe CS3 web premium package. Most of my third-party extensions for Dreamweaver is for classic ASP, and a few can be used for either classic ASP, ASP.net, PHP as well as Cold Fusion. Switching to ASP.net requires visual Web developer which I believe is quite pricey. The express edition it for free. If I use the express in addition, would I be able to follow along using your book? Would I not experienced problems having both development platforms installed on one PC? Would I also be able to switch over to ASP.net using Dreamweaver. At this point in time it's all a matter of costs.

I have not learnt VBScript or VB.net. I have some understanding of VBScript, but pretty limited. For ease of learning, what would you recommend between VB net and C#. Maybe this is not the right place, but what is the opinion of cold fusion?

Historically I have always shied away from forums because of my lack of programming knowledge. I am truly amazed at the response I have received from all. I am really grateful to all. Thank you.

Reading further along your new book, I have noticed that I can use the free version to start learning ASP.net and also follow along in your book. I find myself in a Catch-22 situation, whereby I need to use what I have to earn a living and at the same time changing to a new development platform. The problem is time.

I do already own to wrox books: Beginning Databases and Beginning Active Server Pages 3.0. Is your current book available as an e-book. I find it much easier to read online then to page through a hardcopy book with extremely limited hand function.

Cheers for the moment.

Reply With Quote
  #16 (permalink)  
Old July 3rd, 2008, 01:44 PM
Authorized User
 
Join Date: Jul 2008
Location: Deneysville, Free State, South Africa.
Posts: 12
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Hi Old Pedant,

I have been contemplating for quite some time to switch over to ASP.net. I suppose just some fear of the unknown. Probably about a year ago I got a copy of 180 day trial version of visual studio 2005. I installed on my laptop which was stolen shortly thereafter. I remember downloading a whole other video tutorials from the MSDN website. I'm sure I still have copies of these tutorials on a disk somewhere. Could you possibly tell me some time...

Thank you for the hyperlinks to the other training websites. Over the next couple of days I will spend some time browsing this sites.

When you say it's a different paradigm, please give me an example of what's involved in warping my mind in new ways of thinking.

I believe that the choice is quite easy for me. I need to go the route of ASP.net that will greatly help me develop better applications with less coding.

... I'll try and figure out the prime number riddle when I can focus again.

Cheers
Frakey

Reply With Quote
  #17 (permalink)  
Old July 3rd, 2008, 01:56 PM
Authorized User
 
Join Date: Jul 2008
Location: Deneysville, Free State, South Africa.
Posts: 12
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Greetings to you Matt,

How are things down under?

This is something new... OO type programming. Please explain. I can quite believe you that there is still enormous amount of classic ASP out there. Even here in South Africa. I just need to bite the bullet and do the move to ASP.net in the light that it could certainly help me in being more productive even with my limiting knowledge of coding. It has been a rewarding experience searching to find out how to read some of the coding suggestions made. Still fumbling a bit in the dark... To understand some basics.

Yes, I agree. I am certainly also really beginning to learn a lot from this forum and the support from all you guys. I trust this is the beginning of something great. I certainly intend to be a regular on this forum, especially now that I'm considering changing over to ASP.net. Hopefully in the future I would be able to contribute to other Newby's.

Cheers for now.
Frakey

Reply With Quote
  #18 (permalink)  
Old July 3rd, 2008, 03:26 PM
Friend of Wrox
 
Join Date: Jun 2008
Location: Snohomish, WA, USA
Posts: 1,649
Thanks: 3
Thanked 141 Times in 140 Posts
Default

Quote:
quote:Error Type:
Microsoft VBScript compilation (0x800A0401)
Expected end of statement
/glenvistaCS3_web/News_Results.asp, line 59, column 61
Response.Write("Value is """ & session("AccessLevel")) & """")
------------------------------------------------------------^
You have mismatched parentheses. Always count left and right parens. The numbers must match.

VBScript (and VB.NET) uses a *pair* of quote marks embedded in a quoted string to represent ONE quote mark of actual text.

That is, doing
    Response.Write """"
will produce only a single
    "
to the browser.

Personally, for debugging like this, I avoid using " marks and use some other delimiter. Just easier to read and write.

Also, it's actually a (very minor) error to use parentheses around the argument to Response.Write [doesn't apply in VB.NET, only in VBScript]. So, I would have used:
Code:
Response.Write "Session(AccessLevel) is ==" & Session("AccessLevel") & "==" & vbNewLine
or something like that.

I think Imar and I are both of the opinion that your Session("AccessLevel") value is *NOT* a numeric value and is clearly not 1, which is why you are getting the results you are seeing. It makes sense: If the admin is logged in then his
    Session("userid")
will (presumabely) be indeed his memberid. So if
    Session("accessLevel")
is *NOT* the number 1, then of course you will get the same results for him you do for any other user: Only records with his memberid.

Tell you what. Why don't we really really carefully explore this?

Instead of *JUST* doing the dump of that value (as above) let's do some major checking of the value:
Code:
level = Session("AccessLevel")
isNum = IsNumeric(level)
strLen = Len(level)
vtype = TypeName(level)
Response.Write "Session(AccessLevel) is ==" & level & "==<br>" _
        & "Is it numeric? " & isNum & "<br>" _
        & "As a string, length is " & strLen & "<br>" _
        & "And its TypeName is " & vtype & "" & vbNewLine

See if *THAT* gives us enough info to find the bug.
Reply With Quote
  #19 (permalink)  
Old July 3rd, 2008, 03:34 PM
Friend of Wrox
 
Join Date: Jun 2008
Location: Snohomish, WA, USA
Posts: 1,649
Thanks: 3
Thanked 141 Times in 140 Posts
Default

Just FYI.

You really do *NOT* need to get the full Visual Studio. Honest.

Unless you are working in a team environment, just downloading the free (and MS says it will stay free) "Visual Web Developer Express" is likely all you'll ever need.
    http://msdn.microsoft.com/Express

And, as I said, just browsing around on that site will yield tons of tutorial materials and full-blown example sites and and and.

It's not just the OO aspect of ASP.NET that is different; it's the fact that there are *SO VERY VERY MANY* pre-built "controls" for you to use! Imagine displaying your table from this page you are working on WITHOUT EVERY CODING A LINE. Just by dragging a "GridView" onto a page layout and adding a few selection controls. (Okay, you'll probably have to define a few things in code, but you'll be amazed at how few.)

Play one of the getting-started videos. Play it again. Be convinced. <grin/>
Reply With Quote
  #20 (permalink)  
Old July 3rd, 2008, 04:49 PM
Authorized User
 
Join Date: Jul 2008
Location: Deneysville, Free State, South Africa.
Posts: 12
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Hi Old Pedant,

The results from the new code I have inserted in as follows:

Session(AccessLevel) is ====
Is it numeric? True
As a string, length is 0
And its TypeName is Empty

Hope this gives another to find the bug. I'm sure glad that I can rely on you guys to help trace this bug, I am totally lost.

Regards
Frakey

Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Case Statement In Where Clause Logic dwj119 SQL Server 2000 4 October 27th, 2011 03:14 PM
Problems using case statement in where clause vghiya SQL Server 2000 3 May 28th, 2007 05:12 AM
Select statement with where clause with 2 conditon Yasho VB.NET 2002/2003 Basics 7 May 16th, 2007 01:40 PM
If statement in Where Clause jdziggy SQL Server 2000 2 March 16th, 2007 08:08 AM
USING SQL IF Statement in WHERE clause rit01 SQL Server 2000 17 March 15th, 2007 08:33 AM



All times are GMT -4. The time now is 11:52 PM.


Powered by vBulletin®
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.