Results 1 to 3 of 3
  1. #1
    Join Date
    Jan 2005
    Posts
    7

    Unhappy Unanswered: 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?

  2. #2
    Join Date
    Nov 2003
    Location
    Christchurch, New Zealand
    Posts
    1,618
    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 &")")

  3. #3
    Join Date
    Jan 2005
    Posts
    7
    Aha!! problem solved, thanks!

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •