User Name Password Register
DaniWeb IT Discussion Community
All
What is DaniWeb IT Discussion Community?
You're currently browsing the ASP section within the Web Development category of DaniWeb, a massive community of 397,599 software developers, web developers, Internet marketers, and tech gurus who are all enthusiastic about making contacts, networking, and learning from each other. In fact, there are 2,777 IT professionals currently interacting right now! Registration is free, only takes a minute and lets you enjoy all of the interactive features of the site.
Please support our ASP advertiser: Lunarpages ASP Web Hosting
Views: 1217 | Replies: 3 | Solved
Join Date: Mar 2007
Posts: 13
Reputation: roby4eldiablo is an unknown quantity at this point 
Rep Power: 2
Solved Threads: 0
roby4eldiablo roby4eldiablo is offline Offline
Newbie Poster

Insert Request.Form result into SQL

  #1  
Apr 4th, 2008
Hi all, i need help on asp-sql code.
I have a form when I catch some infos and i want to create a new record into a database.
I have tried many syntax but I can't pass the variables a,b,c,d,e,f to sql string.
Please tell me how can i do it.

  1. <%
  2. a=Request.Form("LastName");
  3. b=Request.Form("FirstName");
  4. c=Request.Form("Street");
  5. d=Request.Form("City");
  6. e=Request.Form("Country");
  7. f=Request.Form("Phone");
  8. Response.write (a+" "+b+" "+c+" "+d+" "+e+" "+f);
  9. var sSQLString;
  10. sSQLString = "INSERT INTO tAuthors (LastName, FirstName, Street, City, Country, Phone) VALUES (a,b,c,d,e,f);"
  11. con.Execute(sSQLString);
  12. %>

Thanks in advance, Roby.
Last edited by peter_budo : Apr 4th, 2008 at 2:33 pm. Reason: Keep It Organized - please use [code] tags
AddThis Social Bookmark Button
Reply With Quote  

Only community members can participate in forum threads. You must register or log in to contribute.

Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)

 

DaniWeb ASP Marketplace
Thread Tools Display Modes

Similar Threads
Other Threads in the ASP Forum

All times are GMT -4. The time now is 6:45 pm.
Forum system based on vBulletin Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
©2003 - 2008 DaniWeb® LLC