Avatar of Bob Schneider
Bob Schneider
Flag for United States of America

asked on 

String or Binary Data May Be Truncated

I am getting this message when trying to insert a record into a sql server db.  I have used this code a lot, as recently as February...wit no difficulty.  All values returned as strings are returning values within the field limits of the database.  I have looked it over a lot in the last week.  Anyone see anything?

Thanks in advance:
[code]
    sMeetName = Replace(Request.Form.Item("meet_name"), "'", "''")
    dMeetDate = Request.Form.Item("meet_date")
    sMeetHost = Replace(Request.Form.Item("meet_host"), "'", "''")
    sWebSite = Request.Form.Item("website")
    sMeetSite = Replace(Request.Form.Item("meet_site"), "'", "''")
    sSport = Request.Form.Item("sport")
    sShowOnline = Request.Form.Item("show_online")
    lMeetDirID = Request.Form.Item("meet_dir_id")
    sLocation = Request.Form.Item("location")

    sql = "INSERT INTO Meets (MeetName, MeetDate, MeetHost, WebSite, MeetSite, Comments, Sport, ShowOnline,"
    sql = sql & " WhenShutdown, MeetDirID, DateReg, Location) VALUES ('"
    sql = sql & sMeetName & "', '" & dMeetDate & "', '"  & sMeetHost & "', '" & sWebSite & "', '"
    sql = sql & sMeetSite & "', '" & sComments & "', '" & sSport & "', '" & sShowOnline & "', '" & dWhenShutdown & "', "
    sql = sql & lMeetDirID & ", '" & Date & "', '" & sLocation & "')"
    Set rs = conn.Execute(sql)
    Set rs = Nothing


[/code]
ASPMicrosoft SQL Server

Avatar of undefined
Last Comment
Partha Mandayam

8/22/2022 - Mon