Results 1 to 3 of 3
  1. #1
    Join Date
    Nov 2003
    Location
    Norway
    Posts
    6

    Unanswered: How to store large text-strings in a sql-field?

    I will store text with more than 8.000 characters in a sql-database. I defined my field as data-type=text. But when I paste a large text string into the database, only some of the text is being saved. The text also changes to "<long text> so I can't change it.

    I tried to make some asp-code to handle the problem, but I can't find the right constants to use according to the data-type=text. In my example I use the constant "adBinary".

    strInfo = Request.Form("txtInfo")
    Set cmd = Server.CreateObject("ADODB.Command")
    With cmd
    .ActiveConnection = MyConn
    .CommandText = "add_Info"
    .CommandType = adCmdStoredProc
    .Parameters.Append .CreateParameter ("@Info", adBinary, adParamInput, , strInfo)
    .Execute lngRecs, , adExecuteNoRecords
    Set cmd = Nothing
    End With

    Is there anybode that can help me?

  2. #2
    Join Date
    Nov 2003
    Location
    Rotterdam, Netherlands
    Posts
    127
    I think you are using SQL-SERVER,
    First check the maximum size allowed in TEXT type of Field.

    I doubt if it can allow so many characters.

  3. #3
    Join Date
    Nov 2003
    Location
    Norway
    Posts
    6
    I found the solution. In the asp-code, I use datatype "varchar" and number of characters like 2147483647.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •