473,385 Members | 1,942 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

Access Import to Pervasive/Btrieve table

1
I currently receive text files that need to be manipulated into a suitable format for uploading into a Pervasive/Btrieve datafile. The text file I receive needs a number of steps to clean it up and so I set up an Access database to perform all the steps and would like to link the output directly to the database table rather than exporting to text and manually importing into the pervasive database table.

I have linked the pervasive data table through an ODBC connection, but I now have an issue where the output being imported into the data file is including the trailing blanks. Example is that the Data file field is a zstring 7, the data imported could be 4 or 5 in length, but on examination of the data file, the field shows the data with 2 or 3 trailing blanks on a key field. The database cannot be altered as it is part of a larger software package.

I use the following sql statement inside of the VB code to do this
[code]
DoCmd.RunSQL sqlstr
sqlstr = " INSERT INTO ZAgents ( Code, Agree_No, Distrib_Date, Distrib_Status, Title)
SELECT NewDMS.Code, rtrim(NewDMS.Code), NewDMS.Date1, NewDMS.Status, NewDMS.Title
FROM NewDMS;"
DoCmd.RunSQL sqlstr
[code]

This is only part of a larger insert statement and as you can see, I have tried "TRIM" and "RTRIM" but neither work.

Any help or directions where I can research will greatly appreciated.
Dec 5 '06 #1
2 3645
MMcCarthy
14,534 Expert Mod 8TB
You could try

Expand|Select|Wrap|Line Numbers
  1. Left(NewDMS.Code, Len(NewDMS.Code))
Expand|Select|Wrap|Line Numbers
  1. Right(NewDMS.Code, Len(NewDMS.Code))
However, I think your problem lies in the parsing of the code and the odbc connection may not be up to the job. As I don't know anything about Pervasive/Btrieve datafiles I can't help further.

I currently receive text files that need to be manipulated into a suitable format for uploading into a Pervasive/Btrieve datafile. The text file I receive needs a number of steps to clean it up and so I set up an Access database to perform all the steps and would like to link the output directly to the database table rather than exporting to text and manually importing into the pervasive database table.

I have linked the pervasive data table through an ODBC connection, but I now have an issue where the output being imported into the data file is including the trailing blanks. Example is that the Data file field is a zstring 7, the data imported could be 4 or 5 in length, but on examination of the data file, the field shows the data with 2 or 3 trailing blanks on a key field. The database cannot be altered as it is part of a larger software package.

I use the following sql statement inside of the VB code to do this
[code]
DoCmd.RunSQL sqlstr
sqlstr = " INSERT INTO ZAgents ( Code, Agree_No, Distrib_Date, Distrib_Status, Title)
SELECT NewDMS.Code, rtrim(NewDMS.Code), NewDMS.Date1, NewDMS.Status, NewDMS.Title
FROM NewDMS;"
DoCmd.RunSQL sqlstr
[code]

This is only part of a larger insert statement and as you can see, I have tried "TRIM" and "RTRIM" but neither work.

Any help or directions where I can research will greatly appreciated.
Dec 5 '06 #2
NeoPa
32,556 Expert Mod 16PB
I too feel that you've hit a limitation of the BTrieve ODBC connection.
You could try appending Char(0) to the end of the string.
If it's a C code library interface (Dim distant memory BTrieve was associated with C) then that will probably work for you.
If it does then you should create a function because all strings passed will need to be processed in the same way.
Dec 5 '06 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

5
by: Chuy | last post by:
I am using Maximizer Enterprise 8.0 as my companies CRM solution. Currently we are using the included Pervasive SQL that shipps with the product. Is there someone out that who could tell me if...
2
by: Martin Marques | last post by:
Is there a possibility to export Btrieve DB files into postgres ?? Any links with information on the respect? -- 10:17:02 up 8 days, 2:07, 4 users, load average: 1.83, 1.13, 0.84...
22
by: Marc Mones | last post by:
Hello, I'working with IBM DB2 V8.1 and CLI/ODBC. I've got a problem with the following statement: ******************************************************************************** SELECT...
0
by: Classic Software, Inc. | last post by:
Need to get some Pervasive SQL or Btrieve data into a Microsoft Access database? For those needing to do so, we sell a very useful tool for Btrieve and Pervasive SQL Databases. Has an explorer...
0
by: Classic Software, Inc. | last post by:
If you are looking for a tool to go from Btrieve to Microsoft Access (or anything else): Data Manager for Btrieve and pervasive SQL. Standard and Enterprise versions. ...
0
by: JSwinney | last post by:
Greetings! I know this kind of question gets asked here almost daily, but as a newbie I have sort of a twist: I'm needing to take some reports I've written in Access that link to Btrieve files...
3
by: Gheaci Maschl | last post by:
Hi all! I would like to have your opinion about my problem and my proposal how to solve it: Ingredients: - BTriev database - Crystal Reports - maybe MS Access - Liinos6 (small ERP software)
7
by: bryant | last post by:
Hi all. I am new to ASP and working in Expression Web. The following query displays the information I need in the gridview for a single record. SELECT "OE_HDR"."ORD_NO", "OE_HDR"."CUST_NAM",...
1
by: bailiss | last post by:
I am trying to save the " (inch mark) and ' (foot mark) into a database. I am not using MySQL regrettably. Instead, I have to use a Pervasive SQL database, version 8.5. The user is supposed to...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.