#1
  1. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Apr 2012
    Posts
    14
    Rep Power
    0

    Recordset is truncated after 255 characters


    I'm trying to read a CSV file into a database using classic ASP. The fields work ok apart from the description field is truncated after 255 characters. Even when I display the field straight after the below command the same issue happens. Looking at the CSV file, nothing seems to be stopping it after 255 characters i.e. carriage returns. A sample of the CSV file is below.


    Code:
    set myRS = myConn.Execute("SELECT [Description] FROM [Text;DATABASE=" & Server.MapPath("/fpdb/") & ";HDR=Yes].[PRD_new.csv]")
    
    Do While not myRS.EOF
    	response.write(myRS("Description"))
    	myRS.MoveNext	
    Loop
    (CSV file)
    Description
    "Many wiki communities are private, particularly within enterprises. They are often used as internal documentation for in-house systems and applications. Some companies use wikis to allow customers to help produce software documentation.[25] A study of cor"
  2. #2
  3. No Profile Picture
    Grumpier old Moderator
    Devshed Supreme Being (6500+ posts)

    Join Date
    Jun 2003
    Posts
    14,441
    Rep Power
    4539
    Maybe it's some limitation with the ado text driver. I've never used that driver.
    ======
    Doug G
    ======
    Bartender to Rene Descartes "have another beer?" Descartes: "I think not" and he vanished.
    --Alfred Bester
  4. #3
  5. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Apr 2012
    Posts
    14
    Rep Power
    0
    I managed to solve this issue. Thanks for the help.
  6. #4
  7. No Profile Picture
    Grumpier old Moderator
    Devshed Supreme Being (6500+ posts)

    Join Date
    Jun 2003
    Posts
    14,441
    Rep Power
    4539
    Originally Posted by frasersales-ltd
    I managed to solve this issue. Thanks for the help.
    I'm glad you got it solved. What was causing the problem?
    ======
    Doug G
    ======
    Bartender to Rene Descartes "have another beer?" Descartes: "I think not" and he vanished.
    --Alfred Bester
  8. #5
  9. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Apr 2012
    Posts
    14
    Rep Power
    0
    There was nothing wrong with the sample CSV file. There was just an error in my code. To prevent the description from being truncated after 255 characters. Some of the descriptions were blank so I deleted those and saved the CSV file. Now it's adding more than 255 characters to the database field.
  10. #6
  11. No Profile Picture
    Grumpier old Moderator
    Devshed Supreme Being (6500+ posts)

    Join Date
    Jun 2003
    Posts
    14,441
    Rep Power
    4539
    Thank you for the update I'm glad it's working for you.
    ======
    Doug G
    ======
    Bartender to Rene Descartes "have another beer?" Descartes: "I think not" and he vanished.
    --Alfred Bester

IMN logo majestic logo threadwatch logo seochat tools logo