Page 1 of 1

Trailing Spaces After Data?

Posted: Fri Aug 31, 2012 4:40 am
by rcandela
I have an <input> field that automatically gets set with a value based on data from a SQL table:

Code: Select all

<input name="FirstName" type="text" id="FirstName" value="<%=(rsUsersMod.Fields.Item("FIRST_NAME").Value)%>" size="20" readonly>
This form on the site is posting the value of the above input table to a New table. So when I insert in to the separate table, the value from that table, it adds a bunch of trailing spaces after the value. Anyone know how to stop the trailing spaces?

Code: Select all

If Request.Form("send") = "requestOff" Then
     strSQL ="SET NOCOUNT ON; " &_
               "INSERT INTO RequestOff (" &_
               "FirstName," &_
               "LastName," &_
               "RequestTypeID," &_
               "StartDate," &_ 
               "EndDate," &_
               "ReasonAbsence," &_
               "Manager," &_
               "Signature," &_
               "DateSubmitted" &_
               ") VALUES (" &_
               "'" & Request.Form("FirstName") & "'," &_
               "'" & Request.Form("LastName") & "'," &_
               "'" & Request.Form("RequestTypeID") & "'," &_
               "'" & Request.Form("StartDate") & "'," &_
               "'" & Request.Form("EndDate") & "'," &_
               "'" & Request.Form("ReasonAbsence") & "'," &_
               "'" & Request.Form("Manager") & "'," &_
               "'" & Request.Form("Signature") & "'," &_
               "'" & Date() & "');" &_
               "SELECT @@Identity AS Ident; "
               'Response.Write(strSQL)
               dbConn.Execute(strSQL)
               IF ((Session("Level") = "Admin")) Then
               ErrorMess = "<font color=#77ae99>Request Has Been Received!</font>"
               Else
               Response.Redirect("log-time.asp?id=" & Request.Form("recordId") & "")
               End If
End If
The SQL column is NCHAR(50)