How import more than 250 characteres in a dataport

DarkHorseDarkHorse Member Posts: 389
Hello, I've an Access database with two "memo" fields. This fields are informed with text. I want to import this information to two text fields in a Navision table. For it I use a dataport. As you know the fileds text date type only let 250 characters, then, on import these fields the process stops and say that the field only let 250 characters.
Is there any way that, for example, only import 250 chacracters (and loose the rest) or you can think any other way to do this?.
Thanks in advance.

Comments

  • Luc_VanDyckLuc_VanDyck Member, Moderator, Administrator Posts: 3,633
    If the memo fields doesn't exceed 1024 characters, you can import them into a global textvariable with length of 1024. Then you can use COPYSTR to split this variable into multiple fields.
    No support using PM or e-mail - Please use this forum. BC TechDays 2024: 13 & 14 June 2024, Antwerp (Belgium)
  • DarkHorseDarkHorse Member Posts: 389
    Thanks for answer. Can you give me an examplo of COPYSTR please?. I suppose all this in dataport.
    Thanks for help.
  • Luc_VanDyckLuc_VanDyck Member, Moderator, Administrator Posts: 3,633
    recMyTable.MyField1 := COPYSTR(txtInputVar,1,250);
    recMyTable.MyField2 := COPYSTR(txtInputVar,251,250);
    recMyTable.MyField3 := COPYSTR(txtInputVar,501,250);
    recMyTable.MyField4 := COPYSTR(txtInputVar,751,250);
    
    This will split a 1000-char variable into 4 table fields with length 250.
    No support using PM or e-mail - Please use this forum. BC TechDays 2024: 13 & 14 June 2024, Antwerp (Belgium)
  • DarkHorseDarkHorse Member Posts: 389
    Perfect;I'll try it.
    Thanks for help.
Sign In or Register to comment.