Update record PROBLEM

Results 1 to 4 of 4

Thread: Update record PROBLEM

  1. #1
    NetBoy Guest

    Default Update record PROBLEM

    I have been fighting with this one for a while. First off, what is the best code path to take as far as editing info in a database. INSERT INTO or vairable.Additem - variable.Update?<BR>The following are the lines of code I am using...I get no errors, but it does not do anything!! Grrrrrrr!<BR><BR>Set Conn = Server.CreateObject("ADODB.Connection") <BR>Conn.Open "QBTMemberSeminar", adLockOptimistic<BR><BR>code = Request.Form("Code")<BR>IntroSemTime = Request.Form("IntroSemTime")<BR>IntroDate1 = Request.Form("IntroDate1")<BR>IntroDate2 = Request.Form("IntroDate2")<BR>IntroLocation = Request.Form("IntroLocation")<BR><BR>Conn = "INSERT INTO SeminarInfo(Code, IntroSemTime, IntroDate1, IntroDate2, IntroLocation) Values(&#039"& code &"&#039, &#039"& IntroSemTime &"&#039, &#039"& IntroDate1 &"&#039, &#039"& IntroDate2 &"&#039, &#039"& IntroLocation &"&#039)"<BR><BR>Any suggestions?<BR>All the info in gathered from a previous page that pushes to this page. I checked that the info was coming over correctly, it just simply will not add the info to the database! HELP!<BR>Thanks,<BR>Jason<BR>

  2. #2
    jhomminga@cmaiglobal.com Guest

    Default RE: Update record PROBLEM

    Looks like you never pulled the trigger.<BR><BR>Change the Conn = "Insert into....."<BR><BR>To read:<BR><BR> Set Rs = Conn.Execute("Insert into....")<BR><BR>

  3. #3
    NetBoy Guest

    Default RE: Update record PROBLEM

    This did not work, and did not give me an error...<BR>what else do you think could be wrong. Again, my exact code is:<BR><BR>Set Conn = Server.CreateObject("ADODB.Connection") <BR>Conn.Open "QBTMemberSeminar", adLockOptimistic<BR><BR>Code = Request.Form("Code")<BR>IntroSemTime = Request.Form("IntroSemTime")<BR>IntroDate1 = Request.Form("IntroDate1")<BR>IntroDate2 = Request.Form("IntroDate2")<BR>IntroLocation = Request.Form("IntroLocation")<BR><BR>Set RS = Conn.Execute("INSERT INTO SeminarInfo(Code, IntroSemTime, IntroDate1, IntroDate2, IntroLocation) Values(&#039"& code &"&#039, &#039"& IntroSemTime &"&#039, &#039"& IntroDate1 &"&#039, &#039"& IntroDate2 &"&#039, &#039"& IntroLocation &"&#039)")<BR><BR>Help?!?!<BR>

  4. #4
    jhomminga@cmaiglobal.com Guest

    Default RE: Update record PROBLEM

    I used a different DSN, and put text directly into variables.<BR><BR>Created a Table in my DSN database name seminarinfo and it appended two records the two times I tried.<BR><BR>No error means a successful record addition.<BR><BR>Experimening with a sample table with no data should get data added to it.<BR><BR>Maybe your overwriting your record that already exist and no validation so the record count doesn&#039t change.<BR><BR>All I did was change to my DSN, create a sample table with the fields you assigned and set the variables directly instead of Request.Form().<BR><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
  •