What i am doing wrong here???

Results 1 to 2 of 2

Thread: What i am doing wrong here???

  1. #1
    Join Date
    Dec 1969

    Default What i am doing wrong here???

    My table (Percentages) is having "Name", "St", "Fed". User enters his "name" and values for "St" and "Fed". If i have the User name in my Table i am inserting the values. Now what it is doing is it is inserting the values in a &#039;new line&#039;. But it has to insert in the same line where the Username exists. I dont know what i am doing wrong her.. help me...<BR><BR>--------------------<BR>Here is the Code:<BR>***************************************** <BR><BR>UserSql = "SELECT * FROM Percentages WHERE Name = &#039;" & EmName & "&#039; "<BR><BR>Set RsUser = Server.CreateObject("ADODB.Recordset")<BR> RsUser.Open UserSql, Conn, 1, 3<BR><BR>If not RsUser.EOF then<BR><BR>mySQL = "INSERT INTO Percentages (St, Fed) "<BR>mySQL = mySQL & " VALUES(&#039;" & MySt & "&#039;, &#039;" & MyFed & "&#039;); "<BR><BR>Set oDB = Server.CreateObject("ADODB.Connection")<BR> oDB.Mode = 3 &#039;adModeReadWrite<BR> oDB.Open dsn<BR> oDB.Execute(mySQL)<BR> oDB.Close<BR>End If

  2. #2
    Join Date
    Dec 1969

    Default RE: What i am doing wrong here???

    You need to do an UPDATE, NOT an INSERT.

Posting Permissions

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