I currently recieve various text files that have to be massaged into a suitable format to up load into a btrieve table. The process was very manul intensive, so I set up an Access database to do all of the work. However when I connect the Access database to the Btrieve table via an ODBC connection I get trailing blanks on the fields that have been set up longer than the actual data going in. For example, Agree_No is a zstring 7, but the data imported could be either 4 or 5 characters in length.
The sql statement that I am using is wrapped inside of a
VB code and its as follows.
DoCmd****nSQL sqlstr
sqlstr = " INSERT INTO ZAgents ( Code, Agree_No, Distrib_Date, Distrib_Status, Title, Name, First_Name, Middle_Name, Sex, Address_Link, Agent_Broker, Region, Agreement_Name, Brk_Rate_VPC, Brk_Rate_NoVPC, EffDate, Service_First,Created, Modified)SELECT NewDMS.Code, rtrim(NewDMS.Code), NewDMS.Date1, NewDMS.Status, NewDMS.Title, NewDMS.Name, NewDMS.First_Name, NewDMS.Middle_Name, NewDMS.Sex, NewDMS.Address_Lnk, NewDMS.Agent_Broker, NewDMS.Region, NewDMS.Agreement_Name, NewDMS.Brk_Rate_VPC, NewDMS.Brk_Rate_NonVPC, NewDMS.Eff_Date, NewDMS.Service_First, Created, Modified FROM NewDMS;"
DoCmd****nSQL sqlstr
I have tried using the trim commands but that doesn't work.
I do have a third party software that I can manually import the data into the table without this issue so there must be a way that I can get access to do the same.