Current location: Hot Scripts Forums » Programming Languages » ASP » Collecting html form data and sending it to a sql table


Collecting html form data and sending it to a sql table

Reply
  #1 (permalink)  
Old 01-04-04, 03:22 PM
crobinson's Avatar
crobinson crobinson is offline
Newbie Coder
 
Join Date: Nov 2003
Posts: 13
Thanks: 0
Thanked 0 Times in 0 Posts
Exclamation Collecting html form data and sending it to a sql table

Just need some help here I am trying to collect form data and send it to a sql table but I seem to be having a little trouble. Here is what I have. Seems to not do anything at all. Any help would be greatly appreciated


<%@ Language="VBScript" %>



<%

Set DataConn = Server.CreateObject("ADODB.Connection")
DataConn.Open Application("DBConnectString")

' assign variables to items in the forms collection.
strStartDate = request.form("StartDate")
strFirstName = request.form("FirstName")
strLastName = request.form("LastName")
strBirthDate = request.form("BirthDate")
strEmployeeID = request.form("EmployeeID")
strReq = request.form("Req")
strWinPass = request.form("WindowsPass")
strDiasPass = request.form("DiasPass")
strBAMPass = request.form("BAMPass")
strUnderTaCode = request.form("UnderTaCode")
strPermTemp = request.form("PermTemp")

'database connection
Set RSEmployeeData = Server.CreateObject("ADODB.Recordset")
RSEmployeeData.Open sSSQL, DataConn, 3

'Sql statement to insert the data
sSQL="INSERT INTO EmployeeData (StartDate, FirstName, LastName, BirthDate, EmployeeID, Req, WindowsPass, DiasPass, BAMPass, UnderTaCode, PermTemp) VALUES ('" _
& strStartDate & "','" & strFirstName & "','" & strLastName & "','" & strBirthDate & "','" & strEmployeeID & "','" & strReq & "','" & strWindowsPass & "','" _
& strDiasPass & "','" & strBAMPass & "','" & strUnderTaCode & "','" & strPermTemp & "')"

' execute it
set RS = DataConn.Execute(sSQL)

Response.Write "Employee Successfully Added!"

' Done. Close the connection object
DataConn.Close
Set DataConn = Nothing
%>

Last edited by crobinson; 01-04-04 at 04:16 PM.
Reply With Quote
  #2 (permalink)  
Old 01-04-04, 08:30 PM
Xtremist Xtremist is offline
Newbie Coder
 
Join Date: Aug 2003
Location: Pensacola, FL
Posts: 99
Thanks: 0
Thanked 0 Times in 0 Posts
Is your form using Post or Get to submit the date?
__________________
Chris
http://www.pensacolawebdesigns.com
I know it's not much but I never find time to work on my own site
Reply With Quote
  #3 (permalink)  
Old 01-04-04, 08:57 PM
crobinson's Avatar
crobinson crobinson is offline
Newbie Coder
 
Join Date: Nov 2003
Posts: 13
Thanks: 0
Thanked 0 Times in 0 Posts
It is using post
Reply With Quote
  #4 (permalink)  
Old 01-04-04, 09:16 PM
crobinson's Avatar
crobinson crobinson is offline
Newbie Coder
 
Join Date: Nov 2003
Posts: 13
Thanks: 0
Thanked 0 Times in 0 Posts
Its fixed

Fixed it thanks Stealth for your help.
Reply With Quote
Reply

Bookmarks


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

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
webform not sending data to DB simone PHP 18 11-24-03 04:43 AM
send email when sending form (asp) bmatth1 Script Requests 0 09-30-03 05:52 AM
Mail Script sending multiple times when Table has a lot of data dsumpter PHP 12 07-16-03 05:17 PM


All times are GMT -5. The time now is 04:01 PM.
vBulletin® Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.