Current location: Hot Scripts Forums » Programming Languages » ASP » Help with ASP & FORMS


Help with ASP & FORMS

Reply
  #1 (permalink)  
Old 01-23-04, 11:22 AM
blessedrub blessedrub is offline
Newbie Coder
 
Join Date: Jan 2004
Posts: 44
Thanks: 0
Thanked 0 Times in 0 Posts
Unhappy Help with ASP & FORMS

Please help me I'm trying to get the data from a form into my database

I'm using the following code could someone please tell me why its not working

<Script Language = vbscript RUNAT = Server>
Function NewPartner(cnn, _
Amount, _
Partnership #,_
First Name, _
Last Name, _
Address, _
City, _
State, _
Zip, _
Phone Number, _
Email)

Dim cmd
Dim SQL

SQL = SQL & "(Amount, Partnership #, First Name, Last Name, Address, City, State, Zip, Phone Number, Date Joined)"
SQL = SQL & " VALUES (' "
SQL = SQL & Amount &" ', '"
SQL = SQL & Partnership # &" ', ' "
SQL = SQL & Name & " ', ' "
SQL = SQL & Address & " ', ' "
SQL = SQL & City & " ', ' "
SQL = SQL & State & " ', ' "
SQL = SQL & Zip & " ', ' "
SQL = SQL & Phone Number & " ', ' "
SQL = SQL & Email & " ', #"
SQL = SQL & Cstr(Date()) & "#)"

Set cmd = Create Object ("ADODB.Command")
cmd.CommandText = SQL
cmd.ActiveConnection = cnn
cmd.Execute

NewPartner = True
Exit Function
On Error Resume Next
NewPartner = False
End Function

Dim cnn
Dim str
Dim Amount
Dim First Name
Dim Last Name
Dim Address
Dim City
Dim State
Dim Zip
Dim Phone Number
Dim Email

Amount = Request.Form("amount")
Name = Request.Form("name")
Address = Request.Form("address")
City = Request.Form("city")
State = Request.Form("state")
Zip = Request.Form ("zip")
Phone Number = Request.Form ("areacode")
Email = Request.Form ("email")

Set cnn = Server.CreateObject("ADODB.Connection")
str = "Data Source = partner"
cnn.open str
cnn.Close
</script>
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiShare on FacebookShare on Stumble UponShare on Twitter
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
Adding information to MySQL database via forms. Dale PHP 8 08-13-05 10:55 PM
load and unload forms in VB.Net warpminded Windows .NET Programming 3 03-16-04 12:07 PM
Dropdown forms problem bastiaan PHP 2 01-04-04 12:27 PM
how to disable "Enter" key in post forms magda JavaScript 2 11-08-03 01:07 AM
Passing a value between forms lordmerlin PHP 1 10-07-03 06:43 AM


All times are GMT -5. The time now is 11:43 AM.
vBulletin® Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.