Wrox Home  
Search P2P Archive for: Go

  Return to Index  

asp_databases thread: About Update statement


Message #1 by "Tsivas" <tsivas@o...> on Sun, 9 Dec 2001 03:34:04
Hi all,

 I'm building a web site that has to do with e-learning. I'm using an 

Access database with OLE-DB Connection. I want the users to be able to 

change their password periodically,but I'm having problems with the update 

statement.Could someone tell me how can I do this? 

Thank you!

--tsivas
Message #2 by "Dallas Martin" <dmartin@z...> on Sat, 8 Dec 2001 22:43:12 -0500
Maybe this???



strSQL = "UPDATE users SET password = '" & password & "' WHERE user_id = &

User_id



Dallas









----- Original Message -----

From: "Tsivas" <tsivas@o...>

To: "ASP Databases" <asp_databases@p...>

Sent: Sunday, December 09, 2001 3:34 AM

Subject: [asp_databases] About Update statement





> Hi all,

>  I'm building a web site that has to do with e-learning. I'm using an

> Access database with OLE-DB Connection. I want the users to be able to

> change their password periodically,but I'm having problems with the update

> statement.Could someone tell me how can I do this?

> Thank you!

> --tsivas




$subst('Email.Unsub').

>



Message #3 by "Ken Schaefer" <ken@a...> on Sun, 9 Dec 2001 15:19:17 +1100
How about providing the SQL Update statement you are having problems with?



Cheers

Ken



~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

From: "Tsivas" <tsivas@o...>

Subject: [asp_databases] About Update statement





:  I'm building a web site that has to do with e-learning. I'm using an

: Access database with OLE-DB Connection. I want the users to be able to

: change their password periodically,but I'm having problems with the update

: statement.Could someone tell me how can I do this?



~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

.



Message #4 by "Tsivas" <tsivas@o...> on Sun, 9 Dec 2001 23:48:31
Hi,

Could anybody help me with the code that has to do with update statement?

I'm using an Access database with OLE-DB Connection.

I have created a form with 3 text fields that a user fills with the old 

password,the new password and the confirmation of the new password.



Here's the code:



<!-- #include file="DataStore.asp" -->

<!-- METADATA TYPE="typelib" 

              FILE="C:\Program Files\Common Files\System\ado\msado15.dll" -

->

<HTML>

<HEAD>

<TITLE>Update Password</TITLE>

</HEAD>

<BODY bgcolor="#FFFFFF" text="#000000">

<% 

  Dim objCmd

  Set objCmd = Server.CreateObject("ADODB.Command")

  strSQL = "UPDATE Students SET Password = '" & Request.Form("txtnewpwd") 

& "' WHERE StudentID = & Session("StudentID")  

  objCmd.CommandText = strSQL

  objCmd.CommandType = adCmdText

  Set objCmd.ActiveConnection = objConn

  objCmd.Execute

  Response.Redirect"UserProfile_after.asp"

 %>

</BODY>

</HTML>



Here's the error:

Error Type:

Microsoft VBScript compilation (0x800A0409)

Unterminated string constant

/onlinecampus/UpdatePassword.asp, line 15, column 76

strSQL = "UPDATE Students SET Password = '" & Request.Form("txtnewpwd") 

& "'



What am I doing wrong??



Thank you!

--tsivas
Message #5 by "Tomm Matthis" <matthis@b...> on Mon, 10 Dec 2001 11:57:10 -0500
You left out the closing parens after the StudentID= :



strSQL = "UPDATE Students SET Password = '" & Request.Form("txtnewpwd") & "'

WHERE StudentID = " & Session("StudentID")



HTHs,



-- Tomm



> -----Original Message-----

> From: Tsivas [mailto:tsivas@o...]

> Sent: Sunday, December 09, 2001 11:49 PM

> To: ASP Databases

> Subject: [asp_databases] About Update statement

>

>

> Hi,

> Could anybody help me with the code that has to do with update statement?

> I'm using an Access database with OLE-DB Connection.

> I have created a form with 3 text fields that a user fills with the old

> password,the new password and the confirmation of the new password.

>

> Here's the code:




  Return to Index