DTS ActiveX VBScript varchar problem

Posted on 2004-11-03
Medium Priority
Last Modified: 2008-02-01
Hi Experts,

I've got an activex script that emails orders out to suppliers.  They need to receive the data in a particular format - and need some field lengths to be a particular size... the problem i'm having is if i use this code....
          elseif x.name = "title" then
          strLine= strLine & chr(34) & left(x.value,4) & chr(34) & chr(44)

and the title field is nchar then i get a field entry of "MR  ",  (which is right) but if the title field is varchar i get "MR",  (which is wrong)

Does anyone know how why this happens or if I can get around it without changing all my database fields?

Many Thanks,
Question by:pjordanna

Accepted Solution

chanito earned 2000 total points
ID: 12483483
Varchar means the field content is just as long as the data you enter.  In any event you can change your script to fix it:

strLine= strLine & chr(34) & left(x.value & "    ",4) & chr(34) & chr(44)

Author Comment

ID: 12492142
that's awesome - thanks chanito

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Backups and Disaster RecoveryIn this post, we’ll look at strategies for backups and disaster recovery.
How much do you know about the future of data centers? If you're like 50% of organizations, then it's probably not enough. Read on to get up to speed on this emerging field.
In this video, Percona Solution Engineer Rick Golba discuss how (and why) you implement high availability in a database environment. To discuss how Percona Consulting can help with your design and architecture needs for your database and infrastr…
This lesson discusses how to use a Mainform + Subforms in Microsoft Access to find and enter data for payments on orders. The sample data comes from a custom shop that builds and sells movable storage structures that are delivered to your property. …
Suggested Courses

840 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question