DeveloperBarn Forums

DeveloperBarn

Programming & IT forum

mdb to SQL SERVER

This is a discussion on mdb to SQL SERVER within the ASP Development forums, part of the Programming & Scripting category; Originally Posted by micky koi baat nahi, chalne lagegi, chinta mat kar You need to check if your recordset has ...

Go Back   DeveloperBarn Forums > Programming & Scripting > ASP Development

  #21  
Old July 14th, 2009, 07:17 AM
Centurion's Avatar
Barn Enthusiast
 
Join Date: Dec 2008
Posts: 352
Rep Power: 2
Centurion is on a distinguished road
Default

Quote:
Originally Posted by micky View Post
koi baat nahi, chalne lagegi, chinta mat kar

You need to check if your recordset has a record or not, before you can read its value like rs("password").
So add such code
Code:
If NOT rs.BOF and NOT rs.EOF
 If oldpassword = "" Or newpassword = "" Then
  Response.Write "Make sure password is valid and fill all the fields please!"
 ElseIf rs("password") <> oldpassword Then
  Response.Write "Wrong password inserted!"
 ElseIf newpassword <> confirmpassword Then
  Response.Write "Confirm password and new password are not the same!"
 ElseIf oldpassword = newpassword Then
  Response.Write "Old password and new password are the same!"
 Else
    
    sql = "UPDATE mem SET password = '" & newpassword & "' WHERE " _
  & "username = '" & Request.Form("username") & "'"

  conn.Execute(sql)
  Response.Write "Your Password has been changed!"
 End If
 End If
rs.Close
 Set rs = Nothing
 conn.Close
 Set conn = Nothing
'End If
you mean?
Code:
If NOT rs.BOF and NOT rs.EOF Then
i have done this and no errors come up but it doesnt seem to change the password.. khalas khatum hoi gya!!!
Reply With Quote
  #22  
Old July 14th, 2009, 07:55 AM
micky's Avatar
Lazy Bum
 
Join Date: Jul 2008
Location: India
Posts: 566
Rep Power: 4
micky has a spectacular aura aboutmicky has a spectacular aura aboutmicky has a spectacular aura about
Default

You need to learn to debug

Debug and see if its going in IF loop or not and if going, then in which IF loop does it go!
__________________
Get the Mantra!
Reply With Quote
  #23  
Old July 14th, 2009, 08:08 AM
Centurion's Avatar
Barn Enthusiast
 
Join Date: Dec 2008
Posts: 352
Rep Power: 2
Centurion is on a distinguished road
Default

Quote:
Originally Posted by micky View Post
You need to learn to debug

Debug and see if its going in IF loop or not and if going, then in which IF loop does it go!
it checks to see if its EOF and its not so then it goes through.. then crashes at password. thats as far as i can debug.. what else can i do?
Reply With Quote
  #24  
Old July 14th, 2009, 08:18 AM
micky's Avatar
Lazy Bum
 
Join Date: Jul 2008
Location: India
Posts: 566
Rep Power: 4
micky has a spectacular aura aboutmicky has a spectacular aura aboutmicky has a spectacular aura about
Default

after the eof line, print the password and see what it brings from database.
Reply With Quote
  #25  
Old July 14th, 2009, 08:22 AM
Centurion's Avatar
Barn Enthusiast
 
Join Date: Dec 2008
Posts: 352
Rep Power: 2
Centurion is on a distinguished road
Default

Quote:
Originally Posted by micky View Post
after the eof line, print the password and see what it brings from database.
as i sed before it just goes to the end if and displays no error..


If NOT rs.BOF and NOT rs.EOF Then
response.write rs("password")
response.end
Reply With Quote
  #26  
Old July 14th, 2009, 08:27 AM
micky's Avatar
Lazy Bum
 
Join Date: Jul 2008
Location: India
Posts: 566
Rep Power: 4
micky has a spectacular aura aboutmicky has a spectacular aura aboutmicky has a spectacular aura about
Default

If its not going inside IF loop, then probably you dont have such record in database.
Reply With Quote
  #27  
Old July 14th, 2009, 08:30 AM
Centurion's Avatar
Barn Enthusiast
 
Join Date: Dec 2008
Posts: 352
Rep Power: 2
Centurion is on a distinguished road
Default

Quote:
Originally Posted by micky View Post
If its not going inside IF loop, then probably you dont have such record in database.
i do have those records!!
Reply With Quote
  #28  
Old July 14th, 2009, 08:34 AM
micky's Avatar
Lazy Bum
 
Join Date: Jul 2008
Location: India
Posts: 566
Rep Power: 4
micky has a spectacular aura aboutmicky has a spectacular aura aboutmicky has a spectacular aura about
Default

Quote:
Originally Posted by wbva View Post
i do have those records!!
Ok, response.write your query and copy that query in your database's query analyzer and see what does it returns!!

As i said, its all debugging now.
Reply With Quote
Reply

  DeveloperBarn Forums > Programming & Scripting > ASP Development

Bookmarks

Thread Tools
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 On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads

Thread Thread Starter Forum Replies Last Post
SQL Server Integration Services guddu Microsoft SQL Server 1 April 24th, 2009 07:08 AM
SQL Server CREATE TABLE..LIKE Wolffy SQL Code Samples 2 March 12th, 2009 04:51 PM
SQL Server 2008 stephenhy88 Microsoft SQL Server 7 August 13th, 2008 01:55 AM
SQL Server Views theChris Microsoft SQL Server 3 March 23rd, 2008 07:35 PM


All times are GMT -4. The time now is 06:34 PM.


Copyright ©2008-2010, DeveloperBarn

Content Relevant URLs by vBSEO 3.3.2