Ask Your Question

hasklo's profile - activity

2019-01-21 18:54:36 +0200 received badge  Famous Question (source)
2019-01-21 18:54:36 +0200 received badge  Notable Question (source)
2018-02-09 15:37:25 +0200 received badge  Student (source)
2018-02-09 13:37:34 +0200 received badge  Popular Question (source)
2018-02-09 13:32:47 +0200 received badge  Nice Answer (source)
2018-02-09 08:42:02 +0200 commented answer import dbase via Basic - how to select character set

Thank you so much, that did the trick! I was looking for a page like this, but didn't turn up on the search... I really

2018-02-09 08:41:02 +0200 received badge  Supporter (source)
2018-02-09 08:40:58 +0200 marked best answer import dbase via Basic - how to select character set

I am trying to programmatically open a dbase (.dbf) file using Basic. It opens fine, but because the file has Chinese characters, it's not displaying the Chinese characters correctly. When I try to open the dbase file manually with Calc, the "Import Dbase files" dialog pops up and asks for the Character set. If I then select "Big5", the file opens and displays Chinese characters correctly.

So my question is: how to open the dbase file using Basic with Character set "Big5"? I have tried the following for my code, but I am not sure what I should set as the value of the FilterOptions.

Dim aDocProps(2) As New com.sun.star.beans.PropertyValue
Dim oDoc as Object

aDocProps(0).Name = "Hidden"
aDocProps(0).Value = False
aDocProps(1).Name  = "FilterName"
aDocProps(1).Value = "dBase"
aDocProps(2).Name  = "FilterOptions"
aDocProps(2).Value = 1

oDoc = StarDesktop.LoadComponentFromUrl(ConvertToURL("my.dbf"), "_blank", 0, aDocProps)

I am using LO 5.3.7.2 x64

Locale: zh-TW (zh_TW)

In the "Options - Language Settings - Languages":

  • Locale setting: Default - Chinese (traditional)
  • Western: Default - English (USA)
  • Asian: Default - Chinese (traditional)

Thanks!

2018-02-09 08:40:58 +0200 received badge  Scholar (source)
2018-02-09 00:43:49 +0200 received badge  Necromancer (source)
2018-02-09 00:42:36 +0200 received badge  Teacher (source)
2018-02-08 16:04:55 +0200 answered a question Characters encoding

Most likely it's the "AutoCorrect" feature. For Calc, look under Tools -> AutoCorrect Options. The first tab should

2018-02-08 11:37:33 +0200 answered a question Calc Basic macro integer arithmetic problem

I know it's been really long since you asked this question... but maybe this can help someone with similar question. An

2018-02-08 11:01:32 +0200 asked a question import dbase via Basic - how to select character set

import dbase via Basic - how to select character set I am trying to programmatically open a dbase (.dbf) file using Basi