472,355 Members | 1,826 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,355 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 1185
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...
2
by: Kemmylinns12 | last post by:
Blockchain technology has emerged as a transformative force in the business world, offering unprecedented opportunities for innovation and efficiency. While initially associated with cryptocurrencies...
0
by: antdb | last post by:
Ⅰ. Advantage of AntDB: hyper-convergence + streaming processing engine In the overall architecture, a new "hyper-convergence" concept was proposed, which integrated multiple engines and...
2
by: Matthew3360 | last post by:
Hi, I have a python app that i want to be able to get variables from a php page on my webserver. My python app is on my computer. How would I make it so the python app could use a http request to get...
0
by: AndyPSV | last post by:
HOW CAN I CREATE AN AI with an .executable file that would suck all files in the folder and on my computerHOW CAN I CREATE AN AI with an .executable file that would suck all files in the folder and...
0
by: Arjunsri | last post by:
I have a Redshift database that I need to use as an import data source. I have configured the DSN connection using the server, port, database, and credentials and received a successful connection...
1
by: Matthew3360 | last post by:
Hi, I have been trying to connect to a local host using php curl. But I am finding it hard to do this. I am doing the curl get request from my web server and have made sure to enable curl. I get a...
0
Oralloy
by: Oralloy | last post by:
Hello Folks, I am trying to hook up a CPU which I designed using SystemC to I/O pins on an FPGA. My problem (spelled failure) is with the synthesis of my design into a bitstream, not the C++...
0
by: Carina712 | last post by:
Setting background colors for Excel documents can help to improve the visual appeal of the document and make it easier to read and understand. Background colors can be used to highlight important...
0
by: Rahul1995seven | last post by:
Introduction: In the realm of programming languages, Python has emerged as a powerhouse. With its simplicity, versatility, and robustness, Python has gained popularity among beginners and experts...

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.