473,403 Members | 2,293 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,403 software developers and data experts.

How to export text files using different character set than the machine locale is?

1
Hi,

I am running MS Access 2003 on an XP machine. I have developed a database which have some of the tables fields in a language different than English (Eastern Europe one, Polish and others), i.e. an Unicode codepage is used as there're some specific non-English characters being used, for example in people's names.

Here comes the tricky part -- I have written a piece of VBA code to export some tables/queries into a flat text files which are to be used later on a website and read using Perl. Everything's fine on the machine which has the Polish localization set, so the export function works great producing flat text files with the codepage ISO-8852. But -- when switching to the UK based machine, when the codepage is different, what happens is just having a 'regular' equivalent of the diacritic character in English. For example, instead of having 'ę', it exports 'e'.

When I export the table using the Menu command (File|Export) and then choosing the Advanced Options and 'Central European (ISO)' as a Code Page, it does work for the text file.

Now, the quesion is: how can I do it from VBA level, when all I do is (some line of the code are removed for the clarity):

Expand|Select|Wrap|Line Numbers
  1. Set qdf = CurrentDb.QueryDefs(rsQuery)
  2. Set rst = qdf.OpenRecordset()
  3. Open rsFileName For Output As #riFile
  4. rec = rst.GetRows(1)
  5. rsTmp = rec(1, 0)
  6. Print #riFile, rsTmp
I know there's probably the work-around having the codepage changed somehow on the machine, but first I don't want to change it and second, I might not have had enough rights to do it as this is a corporate laptop.

Any ideas?

regards,
Grzegorz
Jun 24 '10 #1
2 2714
jimatqsi
1,271 Expert 1GB
I think you want to use the TransferText function. Take a look at some of these threads ...
http://bytes.com/topic/access/answer...5-ms-access-vb


http://bytes.com/topic/access/answer...e-access-table

http://bytes.com/topic/access/answer...ess-db-via-asp

Jim
Jun 24 '10 #2
Oralloy
988 Expert 512MB
Another thing you might try is recording your manual export using a macro, then inspecting the resultant code and transferring the pertenent parts to your VBA code.
Jun 25 '10 #3

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

Similar topics

1
by: Mike Husler | last post by:
We tried to load a file that contained 1 column of datetimes of the format yyyy-MM-dd hh:mm:ss into a table that had the column set as a datetime type. We did this using a DTS package. The error...
0
by: Marshal Antony | last post by:
Hi, I have a web service creates a # delimited text file on a server different than the web server per day for tracking databse transactions.All transactions will be writing to this same text...
6
by: Einar Høst | last post by:
Hi I'm trying to learn a bit about performance, hope someone can help me out I have a text file with 8-bit characters in it. In order to improve performance, I'm using a BinaryReader instead of...
1
by: Aries | last post by:
Hi I need to write programs to read a file and process it with C# in ASP. I need to use C# because other team members which will be joining our team are using C#. Can anyone please show me how...
1
by: svijay | last post by:
hi I have got a strange problem. May I know any solution for this. Here is the detailed description about the problem We have got a mainframe system and also production and development...
1
by: Wayne L | last post by:
I am trying to export text files and would like them to be incremented in the output name field. For instance the output = File1 then = File2 (next time the file was exported) Is this possible?...
0
Dököll
by: Dököll | last post by:
Continued from: http://www.thescripts.com/forum/thread762010.html -VB 6.0 Professional -Microsoft DAO 3.6 Reference Search Database table... An attempt to fetch data housed in Access:
4
by: rachapinky | last post by:
I need to export 2 tables to the same text file. The 2 tables must be exported using different export specifications to the same text file --> the file must be cumulative. Can I do this in...
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: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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:
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
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

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.