|
 |
aspx thread: SV: begin ASp
Message #1 by Aftab Ahmad <aftab.ahmad@k...> on Wed, 13 Dec 2000 16:26:07 +0100
|
|
Hello
You are using wrong insert format of SQL statement. For update
statement we do like "update {table_name} set
address = '" &Request.Form("address") & "'"
But in case of insert statment our statement will like " Insert
into {table_name} (l_name,address)
values ( '" & Request.Form("l_name") & "','"
&Request.Form("address") & "' )"
> -----Opprinnelig melding-----
> Fra: Naraparaju, Venkat [SMTP:VNaraparaju@a...]
> Sendt: 13. desember 2000 16:17
> Til: ASP+
> Emne: [aspx] begin ASp
>
> Hi
> Please help me to write an insert statement.
>
> if (request.querystring("mode")= "insert" and
> Request.Form("dowork")="insert") then
> sqlup = ""
> sqlup = "insert into
> ari.nc_sftyplan_altcontacts "
> sqlup = sqlup & "
> (l_name,address,city,state,zip,telno,email,fax)"
> sqlup = sqlup & " values("
> sqlup = sqlup & "f_name = '" &
> Request.Form("l_name") & "', "
> sqlup = sqlup & "address = '" &
> Request.Form("address") & "', "
> sqlup = sqlup & "city = '" &
> Request.Form("city") & "', "
> sqlup = sqlup & "state = '" &
> Request.Form("state") & "', "
> sqlup = sqlup & "zip = '" &
> Request.Form("zip") & "', "
> sqlup = sqlup & "telno = '" &
> Request.Form("telno") & "', "
> sqlup = sqlup & "email = '" &
> Request.Form("email") & "', "
> sqlup = sqlup & "fax = '" &
> Request.Form("fax") & "') "
> 'sqlup = sqlup & " WHERE client
> '" & Request.QueryString("clientid") & "'"
> 'sqlup = sqlup & " AND division = '" &
> Request.QueryString("group")& "'"
> 'sqlup = sqlup & " AND service_type
> '" & Request.QueryString("service") & "'"
>
> Response.Write (sqlup)
>
> set objCmd = Server.CreateObject("ADODB.Command")
> objCmd.ActiveConnection=objConn
> objCmd.CommandType=adCmdText
> objCmd.CommandText=sqlup
> 'objCmd.Execute
>
---
You are currently subscribed to aspx as: $subst('Recip.EmailAddr')
To unsubscribe send a blank email to leave-aspx-$subst('Recip.MemberIDChar')@p2p.wrox.com
Message #2 by "Naraparaju, Venkat" <VNaraparaju@a...> on Wed, 13 Dec 2000 10:37:26 -0500
|
|
thank you
Venkat
-----Original Message-----
From: Aftab Ahmad [mailto:aftab.ahmad@k...]
Sent: Wednesday, December 13, 2000 10:26 AM
To: ASP+
Subject: [aspx] SV: begin ASp
Hello
You are using wrong insert format of SQL statement. For update
statement we do like "update {table_name} set
address = '" &Request.Form("address") & "'"
But in case of insert statment our statement will like " Insert
into {table_name} (l_name,address)
values ( '" & Request.Form("l_name") & "','"
&Request.Form("address") & "' )"
> -----Opprinnelig melding-----
> Fra: Naraparaju, Venkat [SMTP:VNaraparaju@a...]
> Sendt: 13. desember 2000 16:17
> Til: ASP+
> Emne: [aspx] begin ASp
>
> Hi
> Please help me to write an insert statement.
>
> if (request.querystring("mode")= "insert" and
> Request.Form("dowork")="insert") then
> sqlup = ""
> sqlup = "insert into
> ari.nc_sftyplan_altcontacts "
> sqlup = sqlup & "
> (l_name,address,city,state,zip,telno,email,fax)"
> sqlup = sqlup & " values("
> sqlup = sqlup & "f_name = '" &
> Request.Form("l_name") & "', "
> sqlup = sqlup & "address = '" &
> Request.Form("address") & "', "
> sqlup = sqlup & "city = '" &
> Request.Form("city") & "', "
> sqlup = sqlup & "state = '" &
> Request.Form("state") & "', "
> sqlup = sqlup & "zip = '" &
> Request.Form("zip") & "', "
> sqlup = sqlup & "telno = '" &
> Request.Form("telno") & "', "
> sqlup = sqlup & "email = '" &
> Request.Form("email") & "', "
> sqlup = sqlup & "fax = '" &
> Request.Form("fax") & "') "
> 'sqlup = sqlup & " WHERE client
> '" & Request.QueryString("clientid") & "'"
> 'sqlup = sqlup & " AND division = '" &
> Request.QueryString("group")& "'"
> 'sqlup = sqlup & " AND service_type
> '" & Request.QueryString("service") & "'"
>
> Response.Write (sqlup)
>
> set objCmd = Server.CreateObject("ADODB.Command")
> objCmd.ActiveConnection=objConn
> objCmd.CommandType=adCmdText
> objCmd.CommandText=sqlup
> 'objCmd.Execute
>
To unsubscribe send a blank email to leave-aspx-$subst('Recip.MemberIDChar')@p2p.wrox.com
---
You are currently subscribed to aspx as: $subst('Recip.EmailAddr')
To unsubscribe send a blank email to leave-aspx-$subst('Recip.MemberIDChar')@p2p.wrox.com
Message #3 by Imar Spaanjaars <Imar@S...> on Wed, 13 Dec 2000 16:34:21 +0100
|
|
First of all, this is the wrong list, in my opinion. This is "ordinary"
asp, so has nothing to do with ASP.NET.
Moderator: can you transfer this thread to asp_databases??
Second, can you be more specific about your problem? Do you get an error,
or are there no records updated?
You do a Response.Write of your SQL statement. Please post the outcome of
it to this list, so we can take a look at it.
Also make sure your connection is valid.
Imar
At 04:26 PM 12/13/2000 +0100, you wrote:
>Hello
>
> You are using wrong insert format of SQL statement. For update
>statement we do like "update {table_name} set
> address = '" &Request.Form("address") & "'"
>
> But in case of insert statment our statement will like " Insert
>into {table_name} (l_name,address)
> values ( '" & Request.Form("l_name") & "','"
>&Request.Form("address") & "' )"
>
>
>
>
> > -----Opprinnelig melding-----
> > Fra: Naraparaju, Venkat [SMTP:VNaraparaju@a...]
> > Sendt: 13. desember 2000 16:17
> > Til: ASP+
> > Emne: [aspx] begin ASp
> >
> > Hi
> > Please help me to write an insert statement.
> >
> > if (request.querystring("mode")= "insert" and
> > Request.Form("dowork")="insert") then
> > sqlup = ""
> > sqlup = "insert into
> > ari.nc_sftyplan_altcontacts "
> > sqlup = sqlup & "
> > (l_name,address,city,state,zip,telno,email,fax)"
> > sqlup = sqlup & " values("
> > sqlup = sqlup & "f_name = '" &
> > Request.Form("l_name") & "', "
> > sqlup = sqlup & "address = '" &
> > Request.Form("address") & "', "
> > sqlup = sqlup & "city = '" &
> > Request.Form("city") & "', "
> > sqlup = sqlup & "state = '" &
> > Request.Form("state") & "', "
> > sqlup = sqlup & "zip = '" &
> > Request.Form("zip") & "', "
> > sqlup = sqlup & "telno = '" &
> > Request.Form("telno") & "', "
> > sqlup = sqlup & "email = '" &
> > Request.Form("email") & "', "
> > sqlup = sqlup & "fax = '" &
> > Request.Form("fax") & "') "
> > 'sqlup = sqlup & " WHERE client
> > '" & Request.QueryString("clientid") & "'"
> > 'sqlup = sqlup & " AND division = '" &
> > Request.QueryString("group")& "'"
> > 'sqlup = sqlup & " AND service_type
> > '" & Request.QueryString("service") & "'"
> >
> > Response.Write (sqlup)
> >
> > set objCmd = Server.CreateObject("ADODB.Command")
> > objCmd.ActiveConnection=objConn
> > objCmd.CommandType=adCmdText
> > objCmd.CommandText=sqlup
> > 'objCmd.Execute
> >
>
---
You are currently subscribed to aspx as: $subst('Recip.EmailAddr')
To unsubscribe send a blank email to leave-aspx-$subst('Recip.MemberIDChar')@p2p.wrox.com
|
|
 |