|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
Be the architects of evolution and help create the mobile internet future. It’s your move---enter to win here! |
|
#1
|
|||
|
|||
|
Having problems with ASP and Access
Ok I am trying to submit a form with 8 text boxes.
Code:
<form action="addCustomer.asp" method=post name=frmaddCustomer target="_self">
<tr bordercolor="#333333" bgcolor="#0099FF">
<td width="15%"><input name="CustInput" type="text" size="17"></td>
<td width="9%"><input name="RecInput" type="text" size="14"></td>
<td width="9%"><input name="InvInput" type="text" size="11"></td>
<td width="4%"><input name="CInput" type="text" size="8"></td>
<td width="10%"><input name="ClInput" type="text" size="15"></td>
<td width="10%"><input name="LInput" type="text" size="14"></td>
<td width="11%"><input name="FInput" type="text" size="16"></td>
<td width="32%"><input name="CommInput" type="text" size="33"></td>
</tr>
<tr>
<center>
<td colspan="8"><div align="center">
<input type="submit" name="Submit2" value="Add Customer">
</div></td>
</center>
</tr>
</form>
It submits it to addCustomer.asp. Then it assigns variables to the data... Code:
CustomerInput = Request.Form("CustInput")
ReceivedInput = Request.Form("RecInput")
InvestorInput = Request.Form("InvInput")
ClassInput = Request.Form("CInput")
ClosedInput = Request.Form("ClInput")
LoanInput = Request.Form("LInput")
FeesInput = Request.Form("FInput")
CommentsInput = Request.Form("CommInput")
Then it creates a new record and adds data... Code:
rs.AddNew
rs("employee")=Session("user")
rs("custname")=CustomerInput
rs("received")=ReceivedInput
rs("investor")=InvestorInput
rs("class")=ClassInput
' rs("closing")=ClosedInput
' rs("loanamount")=LoanInput
' rs("fee")=FeesInput
rs("comments")=CommentsInput
rs.Update
The only problem is if i use "closing", "loanamount", and " fee" it gives an error. I can't figure it out ![]() |
|
#2
|
||||
|
||||
|
i would suggest learning sql, instead of using asp's crummy way of inserting records. an insert statement in sql would look somethign like this:
Code:
'stuff for connecting to the DB
<%Set Con = Server.CreateObject("ADODB.Connection")
Con.Open Application("dbRoot")%>
'here is what you would try for an insert statement
sqcode = "insert into tablename (number, text, date) values (1234, 'this is text','2003/10/3 12:00:00:000')"
questions?
__________________
My brain cells are like a storm trooper's armor: useless |
|
#3
|
|||
|
|||
|
so its not working because asp has a crappy way of inserting records?
|
|
#4
|
||||
|
||||
|
post your error so we can see what it is. that's generally a good idea
as lots of people have seen lots of different errors. and yes i think asp's way of inserting records is crappy and its easier to handle using sql statements. but that's just my opinions ![]() |
|
#5
|
|||
|
|||
|
Welll its an Internal Server Error... lol
The page cannot be displayed There is a problem with the page you are trying to reach and it cannot be displayed. -------------------------------------------------------------------------------- Please try the following: Open the home page, and then look for links to the information you want. Click the Refresh button, or try again later. Click Search to look for information on the Internet. You can also see a list of related sites. HTTP 500 - Internal server error Internet Explorer |
|
#6
|
||||
|
||||
|
looks to me like something isn't set up properly on your server, possibly something with IIS. or the file could be corrupt, or doesn't exist. just a few guesses.
|
|
#7
|
|||
|
|||
|
Quote:
It works fine though if i block those three lines of code.... |
|
#8
|
||||
|
||||
|
can you get any data out of the database with a query and display it?
|
|
#9
|
|||
|
|||
|
yes, that works fine, I can add data to except for those three variables
|
|
#10
|
||||
|
||||
|
could you post your table structure and the paramaters for the fields in each? that might help uncover a problem
|
|
#11
|
|||
|
|||
|
If you are using IE you can usually get a more detailed error message if you open Tools - Internet Options - Advanced Options and uncheck the "show friendly http errors" setting.
My guess is there is either missing or incorrect data in the form values for one or more of the offending fields, or there is a typo in the field name. I often use a recordset AddNew, which works just fine for me ![]() |
|
#12
|
|||
|
|||
|
I figured out what it was. Three of my fields were actually set as integer fields and i was trying to send text. Got the problem fix.... Im a NEWBIE whast do yah expect
![]() |
![]() |
| Viewing: Dev Shed Forums > Programming Languages - More > ASP Programming > Having problems with ASP and Access |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|