Why won't this code work?

Results 1 to 2 of 2

Thread: Why won't this code work?

  1. #1
    Join Date
    Dec 1969

    Default Why won't this code work?

    I am passing data to an ASP program as follows:<BR>item1,item2,item3,item4,item5<BR><BR>I am attempting to insert this data into an Access DB. Can anyone point out to me why this code won&#039;t work? Am I just missing something obvious?<BR><BR>Code follows:<BR><BR>&#060;%<BR><BR><BR>&#039;Delete the old Cash Advances from the table.<BR> Set dConn = Server.CreateObject("ADODB.Connection")<BR> dConn.Open "vDirector"<BR><BR> set rs = dConn.Execute("DELETE tblCashAdvances.* FROM tblCashAdvances;")<BR><BR>&#039;Add each of the new Cash Advances back into the table.<BR><BR> set cm = Server.CreateObject("ADODB.Command")<BR> cm.ActiveConnection = "vDirector"<BR> cm.CommandText = "INSERT INTO tblCashAdvances (CashAdvance) VALUES (?);"<BR> cm.CommandType = 1<BR> cm.Prepared = True<BR> cm.Parameters.Append cm.CreateParameter("CashAdvance",200, ,255 )<BR><BR> dim item, strNewCashAdvance<BR><BR> for each item in request.form("selCollection")<BR> strNewCashAdvance = ""<BR><BR> strNewCashAdvance = item<BR><BR> cm("CashAdvance") = strNewCashAdvance<BR> cm.Execute<BR><BR> next<BR><BR>response.redirect("acvs_dir_SelectCash Advance.asp")<BR>%&#062;<BR><BR><BR>Thanks for any and all pointers! If I am missing something obvious please feel free to call me a bonehead......<BR><BR>Chip

  2. #2
    Join Date
    Dec 1969
    Los Angeles, CA

    Default CROSSPOST...in THREE forums.


Posting Permissions

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