473,396 Members | 1,777 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

passing data to my database

Hello to all !!

I have a classic ASP form with checkboxes on it,
when filling out the form I have a submit button.
when users click on the button the information does not get submitted
but the form redirects to my next page

If any one could please guide me on what to look for in my code because I have
been through it three times

thank you cyberdawg999
Jun 26 '07 #1
3 1218
improvcornartist
303 Expert 100+
How are you trying to access the form fields after the form is submitted? Could you post some of the code?
Jun 26 '07 #2
Hello to all !!

I have a classic ASP form with checkboxes on it,
when filling out the form I have a submit button.
when users click on the button the information does not get submitted
but the form redirects to my next page

If any one could please guide me on what to look for in my code because I have
been through it three times

thank you cyberdawg999

improvcornartist is right, having the code will help alot. I know when that append I typically left off a column that I was trying to add data too. Or I had a typo in my add part of my code.
Jun 26 '07 #3
yes how dilly of me

ok here is my code, warning it is quite lenghty.
I think the problem could be I have two submit functions so I think the confusion lies there but im not a ASP expert most of the code is copied from another form

THE CODE:


<table border="0" cellpadding="0" cellspacing="0">
<form method='post' action='/salesdesk/workflowd.asp' name='theForm' onSubmit='return checkrequired(this)'>
<% if f = "e" then %>
<input type="hidden" name="Deal_id" value="<%= iDealID %>">
<% else %>
<input type="hidden" name="company_id" value="<%= iClientID %>">
<input type="Hidden" name="Deal_status" value="<%= strDealStatus %>">
<% end if %>
<input type="hidden" name="f" value="<%=f%>">
<input type="hidden" name="submit2" value="True"></td>
<tr>
<td colspan="4"><img src="/salesdesk/images/spacer.gif" width="1" height="5" border="0"></td>
</tr>
<tr>
<td>Client:</td>
<td colspan="2" height="22" bgcolor="#FFFFFF" style="border:solid 2 #006600;">&nbsp;<%= strClientName %></td>
</tr>

<tr>
<%'this is part of the new form im creating for workflow checkboxes%>
<td><div align="center">Completed Form? </div></td>
<td>
<div align="left">
<input type="checkbox" name="ComlpletedForm" value="yes">
<HR>
</div></td>
</tr>
<tr>
<td><div align="center">Add Client to helpdesk ? </div></td>
<td>
<div align="left">
<input type="checkbox" name="AddClient" value="yes">
<HR>
</div></td>
</tr>
<tr>
<td><div align="center">Send Fax to Mail ? </div></td>
<td>
<div align="left">
<input type="checkbox" name="SendFaxtoMail" value="yes">
<HR>
</div></td>
</tr>

<tr>
<td><div align="center">Debit Order ? </div></td>
<td>
<div align="left">
<input type="checkbox" name="DebitOrder" value="yes">
<hr>
</div></td>
</tr>

<tr>
<td><div align="center">Policy Documents sent ? </div></td>
<td>
<div align="left">
<input type="checkbox" name="PolicyDoc" value="yes">
<hr>
</div></td>
</tr>

<tr>
<td><div align="center">FaxtoSchalk? </div></td>
<td>
<div align="left">
<input type="checkbox" name="FaxtoSchalk" value="yes">
<hr>
</div></td>
</tr>

<tr>
<td><div align="center">Debit Order to Accounts ? </div></td>
<td>
<div align="left">
<input type="checkbox" name="DebitOrdertoAccounts" value="yes">
<hr>
</div></td>
</tr>

<tr>
<td><div align="center">ADSL Usage ? </div></td>
<td>
<div align="left">
<input type="checkbox" name="ADSLUsage" value="yes">
<hr>
</div></td>
</tr>
<tr>
<td><div align="center">Fix VPN IP ? </div></td>
<td>
<div align="left">
<input type="checkbox" name="FixVPNIP" value="yes">
<hr>
</div></td>
</tr>

<tr>
<td><div align="center">Setup VPN ? </div></td>
<td>
<div align="left">
<input type="checkbox" name="SetupVPN" value="yes">
<hr>
</div></td>
</tr>
<tr>
<td><div align="center">Branch Champion Training ? </div></td>
<td>
<div align="left">
<input type="checkbox" name="BCTrain" value="yes">
<hr>
</div></td>
</tr>

<tr>
<td><div align="center">Subscription to Newsletter ? </div></td>
<td>
<div align="left">
<input type="checkbox" name="SubscriptiontoNewsletter" value="yes">
<hr>
</div></td>
</tr>

<tr>
<td><div align="center">Add Transaction to SQL ? </div></td>
<td>
<div align="left">
<input type="checkbox" name="AddtoSQL" value="yes">
<hr>
</div></td>
</tr>
<td colspan="2">

<input type="hidden" name="isSubmitted" value="yes">
</td>

<%if request.form("isSubmitted") = "yes" then%>

<%
DIM all,i
all=False
For i=0 to 15
all=all OR CBOOL(errorArray(i))
Next
If Not all Then

DealName = request.form("DealName")
CompletedForm = request.form("CompletedForm")
AddClient = request.form("AddClient")
SendFaxtoMail = request.form("SendFaxtoMail")
DebitOrder = request.form("DebitOrder")
WelcomeLetter = request.form("WelcomeLetter")
Backups = request.form("Backups")
'RepID = request.form("RepID")
DealID = request.form("DealID")
PolicyDoc = request.form("PolicyDoc")
FaxtoSchalk = request.form("FaxtoSchalk")
DebitOrdertoAccounts = request.form("DebitOrdertoAccounts")
ADSLUsage = request.form("ADSLUsage")
FixVPNIP = request.form("FixVPNIP")
SetupVPN = request.form("SetupVPN")
BCTrain = request.form("BCTrain")
SubscribetoNewsletter = request.form("SubscribetoNewsletter")
ADDtoSQL = request.form("ADDtoSQL")
'DateandTime = request.form("DateandTime")

%>


<% ' this is where the information finally gets submitted to the database
DIM Conn,strConn,SQLstmt,RS,obj_connection,strDBPath, yes
'call OpenConnection
strConn = Server.MapPath("/salesdesk/database/Saleshelpdesk.mdb")
Set obj_connection = server.createobject("ADODB.Connection")
obj_connection.Provider = "Microsoft.Jet.OLEDB.4.0"
obj_connection.Open strConn

strSQL = "INSERT INTO tblWOWConnect " _
& "(CompletedForm, AddClient, DealName,SendFaxtoMail, DebitOrdertoAccounts, WelcomeLetter,Backups, BCTrain, SubscribetoNewsletter, AddtoSQL, PolicyDoc, FaxtoSchalk, ADSLUsage,FixVPNIP,SetupVPN) " _
& "values ('" & request.form("CompletedForm") & "', '" _
& request.form("AddClient") & "', '" _
& request.form("DealName") & "', '" _
& request.form("SendFaxtoMail") & "', '" _
& request.form("DebitOrdertoAccounts") & "', '" _
& request.form("WelcomeLetter") & "', '" _
& request.form("Backups") & "', '" _
& request.form("BCTrain") & "', '" _
& request.form("SubscribetoNewsletter") & "', '" _
& request.form("AddtoSQL") & "', '" _
& request.form("PolicyDoc") & "', '" _
& request.form("FaxtoSchalk") & "', '" _
& request.form("ADSLUsage") & "', '" _
& request.form("FixVPNIP") & "', '" _
& request.form("SetupVPN") & "')"


'on error resume next
Set objRS = obj_connection.execute(strSQL)
If err.number>15then
response.write "VBScript Errors Occured:" & "<P>"
response.write "Error Number=" & err.number & "<P>"
response.write "Error Descr.=" & err.description & "<P>"
response.write "Help Context=" & err.helpcontext & "<P>"
response.write "Help Path=" & err.helppath & "<P>"
response.write "Native Error=" & err.nativeerror & "<P>"
response.write "Source=" & err.source & "<P>"
response.write "SQLState=" & err.sqlstate & "<P>"
end if
IF obj_connection.errors.count>15 then
response.write "Database Errors Occured" & "<P>"
response.write SQLstmt & "<P>"
for counter= 0 to conn.errors.count
response.write "Error #" & conn.errors(counter).number & "<P>"
response.write "Error desc. -> " & conn.errors(counter).description & "<P>"
next
else
response.redirect("helplist.asp")
%>
<strong>Database submission successful !</strong><br>

<%
Jun 27 '07 #4

Sign in to post your reply or Sign up for a free account.

Similar topics

6
by: Rob Meade | last post by:
Hi all, At work we have 2 servers in a cluster for our web apps. One problem we have experienced (along with many others!) - is that if a user is logged into one of the applications on server...
12
by: Kevin Lyons | last post by:
Hello, I am trying to get my select options (courses) passed correctly from the following URL: http://www.dslextreme.com/users/kevinlyons/selectBoxes.html I am having difficulty getting the...
11
by: Arsen Vladimirskiy | last post by:
Hello, If I have a few simple classes to represent Entities such as Customers and Orders. What is the proper way to pass information to the Data Access Layer? 1) Pass the actual ENTITY to...
3
by: Simon Harvey | last post by:
Hi, In my application I get lots of different sorts of information from databases. As such, a lot of information is stored in DataSets and DataTable objects. Up until now, I have been passing...
22
by: Arne | last post by:
How do I pass a dataset to a webservices? I need to submit a shoppingcart from a pocket PC to a webservice. What is the right datatype? II have tried dataset as a datatype, but I can't get it to...
1
by: IMRAN | last post by:
I have created a component which parses some flat files and stores in Sql database. Now I want to move that COM object to database server. Now the scenario will be like this : 1) ASP page...
1
by: rocky20 | last post by:
I am new to .NET and I'm trying to move data from a local database to a remote database. The only way to access the remote database is through a web server. What I want to do is pull the records...
7
by: Jason | last post by:
Hello I've got a very simple C# app, that has a datagrid, a text box, and a button which when clicked opens a second form... Form2 frm2 = new Form2(); frm2.Show(); When I place a datagrid,...
46
by: ahmed.maryam | last post by:
Hi all, I have 2 C# applications that I need to pass data between. Specifically XML information such as a document or node name. How can I do that? Thanks in advance! ~ Maryam
0
by: Magnus Bergh | last post by:
I am developing an application for pocketpc and this involvs a but of juggling with different forms. I have an "order entry" type of application. On the main form I have a grid which displays...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.