Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > ASP.NET and ASP > ASP 3 Classic ASP Active Server Pages 3.0 > Classic ASP Basics
Password Reminder
| 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
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old April 1st, 2009, 12:52 PM
Authorized User
Join Date: Jan 2004
Location: , , .
Posts: 30
Thanks: 1
Thanked 0 Times in 0 Posts
Default How to Change ASP.NET into Classic ASP?

I need to convert a asp.net page back into classic ASP and I am running into problems in getting this accomplished. It is blowing up all over the place.
Help needed now!
Thank you.

I have:

Dim objRS
Set objRS = Server.CreateObject("ADODB.Recordset")

Dim cmd
Set cmd = Server.CreateObject("ADODB.Command")

objConn.Open ConnectionString
cmd.Connection = sqlcon
cmd.CommandText = "sp_setapprole"
cmd.CommandType = CommandType.StoredProcedure

Dim rolename As SqlClient.SqlParameter = cmd.Parameters.Add("@rolename", SqlDbType.VarChar, 20)
rolename.Value = "PW1"
Dim password As SqlClient.SqlParameter = cmd.Parameters.Add("@password", SqlDbType.VarChar, 20)
password.Value = "PW2"


Dim strUser As String
strUser = "DOMAIN\Users"
If (Roles.IsUserInRole(strUser)) Then
End If
Reply With Quote
  #2 (permalink)  
Old April 1st, 2009, 01:09 PM
Wrox Author
Points: 13,255, Level: 49
Points: 13,255, Level: 49 Points: 13,255, Level: 49 Points: 13,255, Level: 49
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
Join Date: Oct 2005
Location: Ohio, USA
Posts: 4,104
Thanks: 1
Thanked 64 Times in 64 Posts
Send a message via AIM to dparsons

O.o Ok. Lots of problems here. First, for everything from your declaration of objRS to cmd.ExecuteNonQuery() go here about 3/4ths of the way down: http://www.15seconds.com/issue/000810.htm

Also you are referring to the same thing by 2 different names. You call objConn.Open then call cn.Open a little while later. Obviously only one of the objects refer to a connection and you only need ot open it once.

Second, since ASP is a weak typed language it has no support for string, int, double, etc during the declaration of the variable and, as such, all variables are defined as variants. So instead of Dim strUser as String you should only do Dim strUser.

ASP does not have a built-in membership/role provider so the call to Roles.IsUserInRole will need to be removed and you will have to write your own method to make this determination.

Lastly, you do not have access to TextBoxes like objects in classic asp. To set the focus of the textbox you are going to need to emit some javascript to achieve the desired result.

Doug Parsons
Wrox online library: Wrox Books 24 x 7
Did someone here help you? Click on their post!
"Easy is the path to wisdom for those not blinded by themselves."
Reply With Quote
The Following User Says Thank You to dparsons For This Useful Post:
GailCG (April 1st, 2009)
  #3 (permalink)  
Old April 22nd, 2009, 06:04 PM
Friend of Wrox
Join Date: Jun 2008
Location: Snohomish, WA, USA
Posts: 1,649
Thanks: 3
Thanked 141 Times in 140 Posts

Well, that was a pretty irrelevant and useless post. Factually correct, but so what. Are you actually fishing for work??? That is, spamming us so you can get your URL in there?
Reply With Quote

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
Converting Classic Asp to Asp.Net 2.0 vikaspatyal ASP.NET 2.0 Professional 2 October 7th, 2007 06:33 PM
asp.net vs classic asp "URGENT" naeem_ul_hussan Classic ASP Professional 1 August 1st, 2007 03:14 PM
classic asp with asp.net on same iis bostonrose .NET Framework 2.0 6 January 10th, 2007 12:38 PM
CLassic ASP in Visual Studio.NET rodmcleay ASP.NET 1.0 and 1.1 Professional 2 September 6th, 2004 08:06 PM
Best Practise for VS.NET IDE and Classic ASP rodmcleay Classic ASP Professional 1 September 3rd, 2004 03:12 PM

All times are GMT -4. The time now is 07:14 AM.

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