I agree with Imar
Besides that: the code you use is very errorprone.
It is good practice to assign all your Request.Forms to variables First.
----- Original Message -----
From: "Imar Spaanjaars" <Imar@S...>
To: "ASP+" <aspx@p...>
Sent: Wednesday, December 13, 2000 4:34 PM
Subject: [aspx] Re: SV: begin ASp
> 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
> > >
> >
>
---
FREE SOFTWARE DEVELOPMENT CODE, CONTENT, AND
INSIGHTS IN YOUR INBOX!
Get the latest and best C++, Visual C++, Java, Visual Basic, and XML tips, tools, and
developments from the experts. Sign up for one or more of EarthWeb?s
FREE IT newsletters at http://www.earthweb.com today!
---
You are currently subscribed to asp_databases as: $subst('Recip.EmailAddr')
To unsubscribe send a blank email to leave-asp_databases-$subst('Recip.MemberIDChar')@p2p.wrox.com