Selected collating sequence not supported by the operating system

本文介绍了一款使用Access数据库的C#软件,在纯英文操作系统中遇到的排序问题及解决方法。问题源于中文版Access默认的汉语拼音排序方式不被英文系统支持,通过调整排序方式并压缩数据库可以有效解决。
用C#开发的一个软件,使用了Access数据库文件(mdb文件)作为后台数据库,之前的测试一直给予中文操作系统或者安装了中文语言包的英文操作系统,当今天将软件部署到纯英文操作系统后,抛出异常:“Selected collating sequence not supported by the operating system. ”。
非常感谢万能的网络以及无私的网络兄弟,最后终于找到了原因:中文版的Access默认的排序方式为按照拼音排序,而英文版的Windows操作系统不支持MDB文件默认的汉语拼音排序方式,所以导致错误。
解决方案(网上主要给出的Office2003下的解决办法,但Office2007的界面和菜单布局和Office2003很不相同,这里补充Office2007下的解决办法):
1、使用Access 2007打开出问题的MDB文件;
2、修改Access的默认排序方案:
Selected <wbr>collating <wbr>sequence <wbr>not <wbr>supported <wbr>by <wbr>...
将系统默认的“汉语拼音”排序修改为“常规”;
3、压缩数据库:
Selected <wbr>collating <wbr>sequence <wbr>not <wbr>supported <wbr>by <wbr>...
选定“压缩和修复数据库”,程序不会做任何提示,而且不需要再次保存,直接关闭Access,再放到英文操作系统下,该问题就已经解决了。
 
 
符:
转自网络的Office 2003的修改排序方法的设置页面【转自 http://www.cnitblog.com/wufajiaru/archive/2009/07/18/43851.html】:
Selected <wbr>collating <wbr>sequence <wbr>not <wbr>supported <wbr>by <wbr>...
在修改完排序方法后的修复操作同Office 2007类似,菜单位置:工具->数据库常用工具->压缩和修复数据库。
不是,我指的句柄是一个sqlite3类型的结构体啊,里面有如下内容struct sqlite3 { sqlite3_vfs *pVfs; /* OS Interface */ struct Vdbe *pVdbe; /* List of active virtual machines */ CollSeq *pDfltColl; /* The default collating sequence (BINARY) */ sqlite3_mutex *mutex; /* Connection mutex */ Db *aDb; /* All backends */ int nDb; /* Number of backends currently in use */ int flags; /* Miscellaneous flags. See below */ i64 lastRowid; /* ROWID of most recent insert (see above) */ i64 szMmap; /* Default mmap_size setting */ unsigned int openFlags; /* Flags passed to sqlite3_vfs.xOpen() */ int errCode; /* Most recent error code (SQLITE_*) */ int errMask; /* & result codes with this before returning */ int iSysErrno; /* Errno value from last system error */ u16 dbOptFlags; /* Flags to enable/disable optimizations */ u8 enc; /* Text encoding */ u8 autoCommit; /* The auto-commit flag. */ u8 temp_store; /* 1: file 2: memory 0: default */ u8 mallocFailed; /* True if we have seen a malloc failure */ u8 bBenignMalloc; /* Do not require OOMs if true */ u8 dfltLockMode; /* Default locking-mode for attached dbs */ signed char nextAutovac; /* Autovac setting after VACUUM if >=0 */ u8 suppressErr; /* Do not issue error messages if true */ u8 vtabOnConflict; /* Value to return for s3_vtab_on_conflict() */ u8 isTransactionSavepoint; /* True if the outermost savepoint is a TS */ u8 mTrace; /* zero or more SQLITE_TRACE flags */ u8 skipBtreeMutex; /* True if no shared-cache backends */ int nextPagesize; /* Pagesize after VACUUM if >0 */ u32 magic; /* Magic number for detect library misuse */ int nChange; /* Value returned by sqlite3_changes() */ int nTotalChange; /* Value returned by sqlite3_total_changes() */ int aLimit[SQLITE_N_LIMIT]; /* Limits */ int nMaxSorterMmap; /* Maximum size of regions mapped by sorter */ struct sqlite3InitInfo { /* Information used during initialization */ int newTnum; /* Rootpage of table being initialized */ u8 iDb; /* Which db file is being initialized */ u8 busy; /* TRUE if currently initializing */ u8 orphanTrigger; /* Last statement is orphaned TEMP trigger */ u8 imposterTable; /* Building an imposter table */ } init;这只是一小部分内容,通过句柄能否知道数据的起始位置
最新发布
10-01
评论 1
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
红包 添加红包
表情包 插入表情
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值