Home | Advertising Info5 USERS CURRENTLY ONLINE   
PowerASP
   Site Search Contact Us Thursday, January 16, 2025  

  Active InfoActive Info  Display List of Info MembersMemberlist  Search The InfoSearch  HelpHelp
  RegisterRegister  LoginLogin
Classic ASP - General
 PowerASP Code Help Area : Classic ASP - General
Subject Info: ASP LOOP !!! HELP !! A d d  -  P o s tAdd P o s t
Author
Message << Prev Info | Next Info >>
geof90
Newbie
Newbie


Joined: August/10/2004
Online Status: Offline
Info: 1
Added: August/10/2004 at 3:38pm | IP Logged Quote geof90

Please hlep with this !! when i register the same username, it the LOOP didn't seem to be working and it didnt' do the redirect, full script is here:

<%

'Dimension variables
Dim adoCon                 'Holds the Database Connection Object
Dim rsAddComments         ;  'Holds the recordset for the new record to be added to the database
Dim strSQL                 'Holds the SQL query for the database

'Create an ADO connection odject
Set adoCon = Server.CreateObject("ADODB.Connection")

'Set an active connection to the Connection object using a DSN-less connection
adoCon.Open "DRIVER={Microsoft Access Driver (*.mdb)}; DBQ=" & Server.MapPath("password.mdb")

'Set an active connection to the Connection object using DSN connection
'adoCon.Open "DSN=password"

'Create an ADO recordset object
Set rsAddComments = Server.CreateObject("ADODB.Recordset")

'Initialise the strSQL variable with an SQL statement to query the database
strSQL = "SELECT * FROM users;"

'Set the cursor type we are using so we can navigate through the recordset
rsAddComments.CursorType = 2

'Set the lock type so that the record is locked by ADO when it is updated
rsAddComments.LockType = 3

'Open the tblComments table using the SQL query held in the strSQL varaiable
rsAddComments.Open strSQL, adoCon

     Do While not rsAddComments.EOF

     If (Request.Form("name")) = rsAddComments.Fields("name") Then
          
     
           'Close Objects before redirecting
           rsAddComments.Close
        Set rsAddComments = Nothing
           Set adoCon = Nothing
          
           'Redirect to the authorised user page and send the users name
           Response.Redirect"authorised_user_page.asp?name=" & strUserName
     End If
     rsAddComments.MoveNext

     Loop




'Tell the recordset we are adding a new record to it
rsAddComments.AddNew

'Add a new record to the recordset
rsAddComments.Fields("name") = Request.Form("name")


'Write the updated recordset to the database
rsAddComments.Update

'Reset server objects
rsAddComments.Close
Set rsAddComments = Nothing
Set adoCon = Nothing

'Redirect to the guestbook.asp page
Response.Redirect "registerinfo.asp"
%>



PLZ hlep!! thanks !!!
Back to Top View geof90's Profile Search for other info by geof90
 

If you wish to make a comment to this info you must first login
If you are not already registered you must first register

  A d d  -  P o s tAdd P o s t
Printable version Printable version

Info Jump
You cannot add new info in this area
You cannot add to info in this area
You cannot delete your info in this area
You cannot edit your info in this area
You cannot create polls in this area
You cannot vote in polls in this area

   Active Server Pages Rule The World
Contact Us  
All artwork, design & content contained in this site are Copyright © 1998 - 2025 PowerASP.com and Christopher J. Williams
Banner ads ,other site logos, etc are copyright of their respective companies.
STATS Unless otherwise noted - All Rights Reserved.

Active Server Pages ASP ASP.NET .aspx .ascx Web HTML Developer Internet Microsoft Web Services Visual Studio .NET CJWSoft ASPProtect ASPBanner ASPClassifieds www.aspprotect.com, www.cjwsoft.com,www.aspclassifieds.com,www.aspphotogallery.com