Update adds a preceeding space
When I update data in an access database, all the text fields get a space added to the begining of the entry (all of the fields that are included in the SQL Update that is). If I edit the field again I get another space added to the field preceeding the data. The number type fields do not appear to be affected. I am using the command object and the code is below.
Thanks
adCmdText = 1
'Start building the SQL string
sql33 = "UPDATE tblEquipment SET tblEquipment.Location = '" & Request.Form("Location") & "', "
sql33 = sql33 & " tblEquipment.Type = '"&Request.Form("Type")&"', "
sql33 = sql33 & " tblEquipment.SerialNumber = '" & Request.Form("SerialNumber") & "', "
sql33 = sql33 & " tblEquipment.Specs = '" & Request.Form("Specs") & "', "
sql33 = sql33 & " tblEquipment.MEDate = '" & Request.Form("MEDate") & "', "
sql33 = sql33 & " tblEquipment.TypeCode = '" & Request.Form("TypeCode") & "', "
sql33 = sql33 & " tblEquipment.Model = '" & Request.Form("Model") & "' "
sql33 = sql33 & " WHERE tblEquipment.MEID = " & Request.Form("MEID") & ";"
Set oConn33 = Server.CreateObject("ADODB.Connection")'Open Connection
oConn33.Open strConnect
'Create the command object
Set oCmd33 = Server.CreateObject("ADODB.Command")
'Set the command object properties
Set oCmd33.ActiveConnection = oConn33
oCmd33.CommandText = sql33
oCmd33.CommandType = adCmdText
'Execute the command
oCmd33.Execute
|