If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Data Access, Manipulation & Batch Languages > ASP > Urgent ASP help required

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 03-07-05, 07:42
ASP-irations ASP-irations is offline
Registered User
 
Join Date: Jan 2005
Posts: 7
Unhappy Urgent ASP help required

Hi

I am trying to add a new record to an oracle database from a form on the previous page. Here is the bit i'm having problems with:

<select name="artist">
<option value="0"></option>
<%Do While Not (objRs.EOF)%>

<option value="<%=objRs("artist_id")%>"> <%=objRs("artist_name")%></option>

option value is a number pulled from the database. The problem is when i submit the form to this asp page:

Dim strartist, strobjConn

strartist=Request.Form("artist")

objConn.execute("insert into artists values('"& strartist &"'"))

it doesnt recognise the option value as a number and returns the error invalid number. What am i doing wrong

Really need urgent help please?
Reply With Quote
  #2 (permalink)  
Old 03-07-05, 17:21
rokslide rokslide is offline
Registered User
 
Join Date: Nov 2003
Location: Christchurch, New Zealand
Posts: 1,617
Well you have wrapped your value in quotes so oracle will think it is meant to be a string would be my first bet, try....
Code:
objConn.execute("insert into artists values("& strartist &")")
Reply With Quote
  #3 (permalink)  
Old 03-09-05, 22:35
ASP-irations ASP-irations is offline
Registered User
 
Join Date: Jan 2005
Posts: 7
Aha!! problem solved, thanks!
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
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 On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On