Wrox Home  
Search P2P Archive for: Go

  Return to Index  

asp_databases thread: inserting values into a table


Message #1 by "Eric Van Camp" <eric.vancamp@c...> on Mon, 27 Nov 2000 12:55:29 -0000
hi,

i got this sql string

sqladd = "INSERT INTO COMPANY(CoyID,Password,CoyName,CoyEmailMaster,Status)

VALUES ('" & UCase(Request.Form("CoyID")) & "','" & Request.Form("Password")

& "','" & Request.Form("CoyName") & "','" & Request.Form("CoyEmail") & "',"

& Request.Form("Status") & ")"



that it want to replace with

sqladd = "INSERT INTO COMPANY(CoyID,Password,CoyName,CoyEmailMaster,Status)

VALUES ('" & UCase(Response.write("strCoyID")) & "','" &

Request.Form("Password") & "','" & Request.Form("CoyName") & "','" &

Request.Form("CoyEmail") & "'," & Request.Form("Status") & ")"

because i want to trip the value of the request.form("coyid") field and i

have to do some processing on this value..

but apparantly i can not insert a variant into this sql,

how do i resolve this problem?

eric



Message #2 by "Ken Schaefer" <ken@a...> on Tue, 28 Nov 2000 12:49:44 +1100
Don't use the Response.Write() bit, change:

> VALUES ('" & UCase(Response.write("strCoyID")) & "','" &



to



VALUES('" & UCase(strCoyID) & "', '" &



---



Above you are concantenating text and variables to create a string.

Response.Write() outputs content to be added to the HTML stream to be sent

to the browser...there is a difference.



Cheers

Ken



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

From: "Eric Van Camp" <eric.vancamp@c...>

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

Sent: Tuesday, November 28, 2000 7:32 AM

Subject: [asp_databases] inserting values into a table





> hi,

> i got this sql string

> sqladd = "INSERT INTO

COMPANY(CoyID,Password,CoyName,CoyEmailMaster,Status)

> VALUES ('" & UCase(Request.Form("CoyID")) & "','" &

Request.Form("Password")

> & "','" & Request.Form("CoyName") & "','" & Request.Form("CoyEmail") &

"',"

> & Request.Form("Status") & ")"

>

> that it want to replace with

> sqladd = "INSERT INTO

COMPANY(CoyID,Password,CoyName,CoyEmailMaster,Status)

> VALUES ('" & UCase(Response.write("strCoyID")) & "','" &

> Request.Form("Password") & "','" & Request.Form("CoyName") & "','" &

> Request.Form("CoyEmail") & "'," & Request.Form("Status") & ")"

> because i want to trip the value of the request.form("coyid") field and i

> have to do some processing on this value..

> but apparantly i can not insert a variant into this sql,

> how do i resolve this problem?

> eric






  Return to Index