how to read asp code only without executing the ad

Results 1 to 3 of 3

Thread: how to read asp code only without executing the ad

  1. #1
    Join Date
    Dec 1969

    Default how to read asp code only without executing the ad

    I have a form wherein on the next page the variables will be passed and added on two tables namely table 1 and table two.<BR>That is, i have two recordsets. <BR>rst1 = Server.CreateObject("ADODB.recordset")<BR>sql = "Select * from table1"<BR>rst1.Open sql, connect<BR>rst.Addnew<BR>rst("Name")= name<BR>rst.Update<BR><BR>rst2 = Server.CreateObject("ADODB.recordset")<BR>sql2 = "Select * from table2"<BR>rst1.Open sql, connect<BR>rst2.Addnew<BR>rst2("Cardnumber")= cardnum<BR>rst2.Update<BR><BR>If i get an error on inputting the cardnum as alpha, it will display an error such as type mismatch. If I go back to the form page and enter the numeric.Then will accept it.<BR>But the problem is, i have now two same records for table1. Is there a way that the asp be read first and then execute only if no errors found?

  2. #2
    Join Date
    Dec 1969

    Default it's called validation

    and there are hundreds of tutorials on it - try for starters.<BR><BR>j

  3. #3
    J. Paul Schmidt Guest

    Default Convert It

    Perhaps convert the following line:<BR>rst2("Cardnumber")= cardnum <BR><BR>To now be (converted to integer):<BR>rst2("Cardnumber")= CInt(cardnum)<BR><BR>Or to now be (converted to long):<BR>rst2("Cardnumber")= CLng(cardnum)<BR><BR>Best regards,<BR>-Paul<BR><BR>J. Paul Schmidt, MBA<BR>Databases on the Web<BR><BR>

Posting Permissions

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