Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Unable to update field

Status
Not open for further replies.

redcare

Technical User
May 20, 2001
32
0
0
GB
Hi I hope somebody can help me.
I am trying to get a text field to update with new information, but it is not holding what I put in.

The syntax I am using is:

<%
If ServerName <> "" Then
sql = "SELECT " & _
"Products.Information, " & _
"FROM Products WHERE (Products.Name_of_server = '" & ServerName & "')"

Set oRS = objConn.Execute(sql)
Information = oRS("Information")
Set oRS = Nothing
end If
%>

Any help would be greatly appreciated.
Regards
Redcare
 
You probably want to spin this around:
Information = oRS("Information")

And also call the Update method on the recordset object before your destroy it.

Search this site or google and you will find a ton of ADO tutorials and sample code.
 
If you're just doing an update then dont bother with a recordset. Use SQL to do the update:
Code:
strUpdateSQL = "UPDATE Products SET Information='" & Information & "' WHERE Name_of_server='" & ServerName & "'"
objConn.Execute strUpdateSQL

Tony

Spirax-Sarco - steam traps control valves heat exchangers
Sun Villa - Luxury Florida accommodation
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top