Wrox Home  
Search P2P Archive for: Go

  Return to Index  

asp_databases thread: Strange string behaviour?!


Message #1 by "Bengt" <asp@k...> on Wed, 24 May 2000 15:16:37
Hello,



Why doesn't this code work:



	strForf = "x "

	Do Until RSForfAlla.EOF

		strForf = strForf & RSForfAlla("ForfE") & " " & RSForfAlla("ForfF")

		RSForfAlla.MoveNext

		If Not RSForfAlla.EOF Then

			strForf = strForf & ", "

		End If

	loop

	conn.Execute "UPDATE Produkt SET " & _

		"Produkt.Benamn2 = '" & strForf & "'" & _

		"WHERE (ProdNr='" & Request.Form("ProdNr") & "')"



The field is just updated with "x ", nothing more! Why?



But this code works:



	strForf = "x "

	Do Until RSForfAlla.EOF

		strForf = strForf & RSForfAlla("ForfE") & " " & RSForfAlla("ForfF")

		RSForfAlla.MoveNext 

		If Not RSForfAlla.EOF Then

			strForf = strForf & ", "

		End If

	loop

Response.Write(strForf) 

%>



The Response.Write(strForf) actually writes all I expect it to write, not just "x ".



Any suggestions? Why does the string "strForf" hold different information in the two cases?



Bengt




  Return to Index