ASP Programming
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsProgramming Languages - MoreASP Programming

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
Be the architects of evolution and help create the mobile internet future. It’s your move---enter to win here!
  #1  
Old October 3rd, 2003, 01:23 PM
ejmack ejmack is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Oct 2003
Posts: 18 ejmack User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 3 h 23 m 2 sec
Reputation Power: 0
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

Reply With Quote
  #2  
Old October 3rd, 2003, 01:32 PM
don_sparko's Avatar
don_sparko don_sparko is offline
Digitally Challenged
Dev Shed Newbie (0 - 499 posts)
 
Join Date: May 2003
Posts: 280 don_sparko User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 54 m 14 sec
Reputation Power: 6
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

Reply With Quote
  #3  
Old October 3rd, 2003, 01:35 PM
ejmack ejmack is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Oct 2003
Posts: 18 ejmack User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 3 h 23 m 2 sec
Reputation Power: 0
so its not working because asp has a crappy way of inserting records?

Reply With Quote
  #4  
Old October 3rd, 2003, 01:41 PM
don_sparko's Avatar
don_sparko don_sparko is offline
Digitally Challenged
Dev Shed Newbie (0 - 499 posts)
 
Join Date: May 2003
Posts: 280 don_sparko User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 54 m 14 sec
Reputation Power: 6
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

Reply With Quote
  #5  
Old October 3rd, 2003, 01:42 PM
ejmack ejmack is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Oct 2003
Posts: 18 ejmack User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 3 h 23 m 2 sec
Reputation Power: 0
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

Reply With Quote
  #6  
Old October 3rd, 2003, 01:46 PM
don_sparko's Avatar
don_sparko don_sparko is offline
Digitally Challenged
Dev Shed Newbie (0 - 499 posts)
 
Join Date: May 2003
Posts: 280 don_sparko User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 54 m 14 sec
Reputation Power: 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.

Reply With Quote
  #7  
Old October 3rd, 2003, 01:48 PM
ejmack ejmack is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Oct 2003
Posts: 18 ejmack User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 3 h 23 m 2 sec
Reputation Power: 0
Quote:
Originally posted by don_sparko
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.


It works fine though if i block those three lines of code....

Reply With Quote
  #8  
Old October 3rd, 2003, 01:57 PM
don_sparko's Avatar
don_sparko don_sparko is offline
Digitally Challenged
Dev Shed Newbie (0 - 499 posts)
 
Join Date: May 2003
Posts: 280 don_sparko User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 54 m 14 sec
Reputation Power: 6
can you get any data out of the database with a query and display it?

Reply With Quote
  #9  
Old October 3rd, 2003, 02:02 PM
ejmack ejmack is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Oct 2003
Posts: 18 ejmack User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 3 h 23 m 2 sec
Reputation Power: 0
yes, that works fine, I can add data to except for those three variables

Reply With Quote
  #10  
Old October 3rd, 2003, 03:15 PM
don_sparko's Avatar
don_sparko don_sparko is offline
Digitally Challenged
Dev Shed Newbie (0 - 499 posts)
 
Join Date: May 2003
Posts: 280 don_sparko User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 54 m 14 sec
Reputation Power: 6
could you post your table structure and the paramaters for the fields in each? that might help uncover a problem

Reply With Quote
  #11  
Old October 3rd, 2003, 04:10 PM
Doug G Doug G is offline
Grumpier Old Moderator
Dev Shed God 12th Plane (10500 - 10999 posts)
 
Join Date: Jun 2003
Posts: 10,719 Doug G User rank is Brigadier General (60000 - 70000 Reputation Level)Doug G User rank is Brigadier General (60000 - 70000 Reputation Level)Doug G User rank is Brigadier General (60000 - 70000 Reputation Level)Doug G User rank is Brigadier General (60000 - 70000 Reputation Level)Doug G User rank is Brigadier General (60000 - 70000 Reputation Level)Doug G User rank is Brigadier General (60000 - 70000 Reputation Level)Doug G User rank is Brigadier General (60000 - 70000 Reputation Level)Doug G User rank is Brigadier General (60000 - 70000 Reputation Level)Doug G User rank is Brigadier General (60000 - 70000 Reputation Level)Doug G User rank is Brigadier General (60000 - 70000 Reputation Level)Doug G User rank is Brigadier General (60000 - 70000 Reputation Level)Doug G User rank is Brigadier General (60000 - 70000 Reputation Level)Doug G User rank is Brigadier General (60000 - 70000 Reputation Level) 
Time spent in forums: 1 Month 50 m 18 sec
Reputation Power: 688
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

Reply With Quote
  #12  
Old October 3rd, 2003, 04:49 PM
ejmack ejmack is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Oct 2003
Posts: 18 ejmack User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 3 h 23 m 2 sec
Reputation Power: 0
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

Reply With Quote
Reply

Viewing: Dev Shed ForumsProgramming Languages - MoreASP Programming > Having problems with ASP and Access


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


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

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 

IBM developerWorks