Update and Select

  • I am making an update into a tabe on SQl2005

    sql = "Update web Set answer7='" & answer7 & "'" & " where erkennung=" & erkennung

    then I am passing to the next Asp site by response redirect.

    on the next site start9b.asp:

    sql= "select* from web where erkennung=" & erkennung

    this works fine. I can see the record RS("answer7"), but no other fields of the table.

    For example RS("username") stays empty, but the username is in the same row like answer7 of the table. I can see it in the SQL table in the same row on the server.

    Something to do with upgrade, I have no idea ?

  • I'm not sure what you mean about the upgrade. Did you mean update?

    The update changes the field specified only. If there is a username field in the web table, it's not affected.

    You should not use SELECT *. Choose the fields you really need and pull those back specifically, that will help you troubleshoot.

    You can also use SSMS to see what that row has in it by running the select against the server/database/table.

  • Thanks.

    First I inserted the first name and name with insert into the table .

    ql= "INSERT INTO web(first name ,name,... )VALUES('" & first name & "','" & name & "', ... )"

    Then by update into the fields answer1, answer2...

    you are right about the select command.

    sql= "select vorname, name, answer1, answer2, answer3, ... answer7 from web where erkennung=" & erkennung

    But i can now only see a part of the fields.

    I can see

    to

    but not

    It is empty on the webpage, but the fields in the table web are with the data.

    I have now idea yet

  • what ist SSMS ?

  • SSMS -> SQL Server Management Studio

  • your post got cut off, can you explain what "part" means?

  • I can only see rs("id"), rs("answer7"), rs("time")

    but not rs("first name"), rs("name"),rs("answer1"), rs("answer2"), .....

    on the web site

  • Here is the answer, ... I found it.

    it depends on the order in the SQL statement of the columns;: SQL = Select id, first name, name, answer1, .... from tabel....

    And ho you use it on the website,

    rs("id") rs("first name") .... , By changing in the SQL Statement the order id, name, first name...

    it works again.

Viewing 8 posts - 1 through 7 (of 7 total)

You must be logged in to reply to this topic. Login to reply