为何DBRichEdit构件编辑和显示汉字时总成乱码?——急求好构件和解决方案!

trybird 2000-06-17 09:17:00
请教各位大侠:

DBRichEdit构件对汉字的支持不是很好!编辑和显示汉字时总成乱码!
急求有处理这方面经验的高手提供好构件和解决方案!
构件要功能全,有原码!多谢!





...全文
277 8 打赏 收藏 转发到动态 举报
写回复
用AI写文章
8 条回复
切换为时间正序
请发表友善的回复…
发表回复
trybird 2000-07-04
  • 打赏
  • 举报
回复
是DbRicheidt构件本身的问题!很多用CB或Delphi开发的程序员也遇上过这个问题,
英文没问题,只是处理汉字出问题,尤其是键盘上的减号“-”变成全角的“-”时,
更是乱码多多!由于时间紧,我们还没去研究构件的原码。

但问题早已解决——用DbMemo构件!多谢众友!
虽是自行解决,但为答谢各位朋友的热心助人精神,将分送出!
trybird 2000-06-17
  • 打赏
  • 举报
回复
是从数据库存取数据的DBRichEdit构件,如果只是一个人的问题,也罢!
可我们开发部几个人都是如此,怎么回事?是DBRichEdit,不是BRichEdit。
对应SQL Server(7.0) 中的Text型字段,存的好好的,一编辑就存成乱码,
滚动记录也显示很多乱码,将表导出到Excel里,相应字段也成乱码!
Wingsun 2000-06-17
  • 打赏
  • 举报
回复
要不,你从别的地方拷贝RichEdit.ocx覆盖你的机器上的试一试。
Wingsun 2000-06-17
  • 打赏
  • 举报
回复
不可能吧,我的没有问题啊。
trybird 2000-06-17
  • 打赏
  • 举报
回复
我们的DBRichEdit早已设成“宋体”,但还是不行!
多谢指教,请再赐教!
Wingsun 2000-06-17
  • 打赏
  • 举报
回复
你可以不用别的东西,只要将DBRichEdit的字体改成中文的字体即可。RichEdit似乎都有这个问题,当字体是西文时就会不能正常显示中文,改成中文字体就好了。
potato 2000-06-17
  • 打赏
  • 举报
回复
我也遇到同样问题,使用DbRicheidt和RichEdit控件出现中文乱码问题。但不是每次都出现,只是有时会出现。特别是将剪贴板中的中文粘贴到DbRichEdit 编辑框中时,经常出现问题,由于不是每次都出现乱码,我也无法找出原因。听说将Wordwrap 设置成 False 可解决问题,我正准备试一试。
Wingsun 2000-06-17
  • 打赏
  • 举报
回复
但是在我的机器作的实验证明没有问题啊。可否看一下你的源程序。
不用第三方控件,让richEdit支持图片与表格换行 DELPHI 6 提供的RICHEDIT是1.0,并不支持图片,对复杂表格也会乱成一团,如何在DELPHI原有控件的基础上做少量修改,使之支持显示图片与正确显示表格,其实只需要几行就好了,方法如下: 找到richEdit控件所在单元ComCtrls.pas (在SOURCE\VCL) //第一步 procedure TCustomRichEdit.CreateParams(var Params: TCreateParams); const // RichEditModuleName = 'RICHED32.DLL';//原来语句 // RichEditClassName = 'RICHEDIT'; //原来语句 RichEditModuleName = 'Msftedit.dll'; //改后语句 RichEditClassName = 'RichEdit50W'; //改后语句 //第二步 procedure TCustomRichEdit.CreateWnd; .... //加入一行要放在 CreateWnd 因为此 HANDLE已建立 Perform(EM_SetOleCallback, 0, Longint(TRichEditOleCallback.Create(TRichEdit(self)) as IRichEditOleCallback)) ; //第三步 procedure TCustomRichEdit.WMRButtonUp(var Message: TWMRButtonUp); begin inherited; // RichEd20 does not pass the WM_RBUTTONUP message to defwndproc, // so we get no WM_CONTEXTMENU message. Simulate message here. // if Win32MajorVersion < 5 then //是原有1.0的要去掉 Perform(WM_CONTEXTMENU, Handle, LParam(PointToSmallPoint( ClientToScreen(SmallPointToPoint(Message.Pos))))); end; //第四步 procedure TRichEditStrings.Insert(Index: Integer; const S: string); .... //要去掉后面两名 // 1.0 uses, 2.0 will error happened 2011 // if RichEdit.SelStart (Selection.cpMax + Length(Str)) then //是原有1.0的要去掉 // raise EOutOfResources.Create(sRichEditInsertError); //是原有1.0的要去掉
这个数据库看性能不错,哪位能破解一下。Overview Absolute Database: Delphi database with SQL support.Absolute Database lets you forget the Borland Database Engine (BDE). This BDE replacement is the compact, high-speed, robust and easy-to-use database engine. With Absolute Database you will not need special installation and configuration, it compiles right into your EXE. Make your application faster and smaller with Absolute Database BDE alternative!An individual may use Absolute Database Personal in a project if he / she is the only user of this project. If your project is public or if you represent a company, you must order commercial edition of Absolute Database.Key Features: No BDE; no DLLs Single-file database SQL‘92 (DDL & DML) support Single-user and multi-user mode (file-server) Unmatched ease-of-use 100% compatibility with standard DB-aware controls Strong encryption BLOB compression Free for personal use Full source code available Royalty-free Specification Ease of Deployment No BDE, no DLLs No special installation or configuration required Database engine compiles right into EXE Single-file database format Database file could be merged with the application EXE file High Speed Advanced cache management and buffering architecture Sophisticated SQL query and filter optimizer Special optimized database engine for temporary results of SQL queries Fast B*-Tree indexes with high-speed on thousands and on millions of records Buffered transactions for batch inserts, updates and deletes In-memory tables for fast operations with data loaded into memory Optimization for read-only databases, such as databases on CD High-concurrency design for multi-threaded applications Multi-User Zero-admin file-server Automatic record and table locking Automatic detection of changes made by other users Configurable limit of concurrent connections Easy switching between single-user and multi-user mode Full transactions support with ReadCommited isolation level SQL Support SELECT with DISTINCT, INNER LEFT, RIGTH, FULL and OUTER JOIN, GROUP BY and ORDER BY clauses CREATE TABLE, DROP TABLE, ALTER TABLE statements CREATE INDEX, DROP INDEX statements INSERT, UPDATE, DELETE statements BETWEEN, IN, LIKE, IS NULL, EXISTS operators Aggregate functions COUNT,SUM,MIN,MAX,AVG Most of all SQL‘92 arithmetic, logical, date-time and string functions and operators Data types conversion by function CAST SQL scripts (multiple commands separated by ‘;‘) Parameters in queries SELECT from several databases in one query Correlated and non-correlated subqueries Compactness Small size of code added into the application by the database engine units Small database file size achieved by customizable page size, compression of table metadata and other special means Automatic free space recycling for data records, index pages, and BLOB blocks Fast BLOB data compression Short indexes for string fields Low memory consumption Compatibility Support of most of TTable field data types, including BLOB fields Full compatibility with standard DB-aware visual controls such as QuickReport, DBGrid, DBNavigator, DBImage, DBMemo, DBRichEdit and others Calculated and lookup fields Most of TTable functions including Key and Range methods Support for the IProvider interface (TClientDataSet) Functionality Unicode support in String and Memo fields Multiple-fields indexes with descending, ascending, case-sensitive and insensitive options Shareable tables Default values support Min, max and not null constraints on field values Export to SQL script (reverse engineering) Security Strong encryption of database file Variety of supported encryption algorithms: Rijndael, the Advanced Encryption Standard (AES) winner 128 bit key, Rijndael 256 bit key, Blowfish 448 bit key, Twofish 128 bit key, Twofish 256 bit key, Square, Single DES and Triple DES Reliability Repair database in case of hardware failure or operating system error caused by another application Auto-detect of database corruption and automatic repair of database file Convenience Table restructuring being performed in the easiest way keeping all the existing data Data importing from and exporting to any dataset Internationalization / localization support by use of current system locale Displaying progress during potentially slow operations with the tables and databases Utilities DBImportExport utility to transfer your existing tables from database systems with BDE driver, such as Paradox, Interbase, Access, Oracle, SQL Server to Absolute Database format and vice versa. Absolute Database Manager to manage a database easily and to perform all supported operations with tables and database file Absolute Database Manager also provides you an easy way of executing SQL queries All utilities come with full source code and can be used as an advanced examples Ease of Development Full compatibility with TTable, TQuery, TSession and TDatabase components Extensive documentation: Developer‘s Guide and Reference covering every development issue. Large number of demos illustrating wide range of use cases Prompt and responsive technical support Cost-Effectiveness 100% royalty-free, i.e. there is no additional licensing fees no matter how many times you deploy the application Flexible licensing: source code and no source code versions, multi-developers licenses Comparison with other Databases You can see here Comparision with other databases Maximum Capacity SpecificationsObject Maximum sizes / numbers Multi-User Edition Single-User Edition Bytes per string field 64,000 (also limited by page size) 64,000 (also limited by page size) Bytes per BLOB field 2GB 2GB Bytes per index 64,000 (also limited by page size) 64,000 (also limited by page size) Bytes per row 65,400 (also limited by page size) 65,400 (also limited by page size) Columns per index 10,000 10,000 Columns per table 65,000 65,000 UNIQUE indexes or constraints per table 30,000 30,000 Database size 32 TB (also limited by file system and OS) 32 TB (also limited by file system and OS) Identifier length (in characters) 255 255 Locks per connection 2,147,483,647 N/A Rows per table 2,147,483,647 2,147,483,647 Tables per database 2,147,483,647 2,147,483,647 Bytes per page 65,536 65,536 Pages per database file 2,147,483,647 2,147,483,647 Connections per database Maximum value of configured connections before creating database file (up to 2,147,483,647) 1 Records in transaction 2,147,483,647 (also limited by available RAM) 2,147,483,647 (also limited by available RAM) In-memory table size 2,147,483,647 (also limited by available RAM) 2,147,483,647 (also limited by available RAM) Requirements Target Development Environment:Delphi 4, Delphi 5, Delphi 6, Delphi 7 and C++ Builder 4, C++ Builder 5, C++ Builder 6. Trial and Personal editions of Delphi are not supported.Target OS:Windows 95/98/ME, Windows NT, 2000, XP
SQLMemTable for Delphi / C++ Builder: README============================================Please read this file carefully (especially the INSTALLATION chapter) before installing the program to your computer.Contents-------- Program information Company information Description Specification Features and Benefits Installation Purchasing / Registration Copyright and licenses Warranty and guarantee Technical support Important note Other products recommended to useProgram information-------------------Program Name: SQLMemTableLicense Types: Personal (for personal use, without source code) Com (for 1 developer, without source code) Pro (for 1 developer, with source code) Team4 (for 4 developers, with source code) Team8 (for 8 developers, with source code) Enterprise (Enterprise License - for entire company, with source code)Program Version: 1.00Program Release Date: 07/15/2003Program Purpose: SQLMemTable is a compact, fast and powerful in-memory table with SQL support. Target Environment: Delphi 4, 5, 6, 7 and C++ Builder 4, 5, 6.Company information-------------------Company Name: AidAim SoftwareContact E-mail Address: support@aidaim.comContact WWW URL: http://www.aidaim.comDescription-----------SQLMemTable is a compact in-memory table with SQL support for Delphi and C++ Builder. SQLMemTable does not require BDE and provides all the TTable‘s functionssuch as Master/Detail relationship, Filtering, Searching, Sorting, Key, Range, BLOB fields, and has some advanced features such as BLOB data compression, multi-indexes and table restructuring, shareable in memory capabilities. It is fully compatible with all standard DB controls, supports calculated and lookup fields as well as internationalization/localization and Unicode, provides data importing from and exporting to any dataset, includes SQLConsole utility with source code, comprehensive help and demos.SQLMemTable provides the following services: - SQL support - Master / detail relationship - Creating, renaming, emptying, deleting and restructuring tables - Creating, editing, deleting, navigating and searching for records - Creating and deleting multiple indexes - Calculated and lookup fields - Filtering support - Using BLOB fields with data compression ability - Importing from and exporting to any dataset in fast and easy way - Internationalization/Localization and Unicode supportSQLMemTable does not require BDE or any external drivers and has small footprint. Its search performance is excellent and data access speed is extremely fast.Specification-------------Data types: ftAutoInc, ftInteger, ftSmallInt, ftFloat, ftDateTime, ftDate, ftTime, ftBLOB, ftMemo, ftGraphic, ftString (any fixed length string), ftCurrency, ftWord, ftBoolean, ftLargeInt, ftFmtMemo, ftBytes, ftWideString.Advanced data types: aftExtended, aftWideMemoMaximum records quantity: up to 2^31 (over 2 billions). Maximum fields per table: 2^31 (over 2 billions). Maximum indexes per table: 2^31 (over 2 billions). Maximum index fields per index: 2^31 (over 2 billions). Maximum field name‘s length: 255 characters.Maximum index name‘s length: 255 characters.BLOB fields block size: > 1 byte, default 100 Kb. BLOB compression: ZLib, BZip, PPM Search operators: <,>,=,<>,<=,>=, like, not like, is null, is not null, and, or, not, (). Features and Benefits---------------------Compactness. - Short compiled code with approximate size 300 Kb, no external drivers (such as BDE) required. - Small memory consumption by SQLMemTable database engine. - Fast BLOB data compression. Your large data fields will need less memory. SQLMemTable can compress data on the fly. The compression routines used in the SQLMemTable are much faster than most of popular archivers like PKZip, WinRar, Arj. High performance. - Fast search by B-tree indexes. At the moment SQLMemTable is one of the fastest existing in-memory tables for Delphi and C++ Builder. - High-speed memory operations performance is achieved by means of using specially optimized memory manager and tuned algorithms. - Quick operations with strings. SQLMemTable compares strings up to 3 times faster than standard Delphi string routines. High performance is achieved by using a special library written in Assembler and an advanced sorting algorithm. - Advanced SQL optimizer often makes query execution several times faster by choosing the best execution plans. Functionality. - A subset of SQL‘92 including DDL operators is supported by TSQLMemQuery component. With SQLMemTable you can create SQL scripts for creating tables, inserting, editing and deleting records, retrieving data by SELECT command. - Advanced search engine. SQLMemTable supports ‘LIKE‘ operator with wildcards ‘%‘ and ‘_‘, as well as ‘IS NULL‘ and ‘IS NOT NULL‘ in filters and queries. - Full multiple index support, i.e. numerous fields in a table may comprise an index. SQLMemTable provides descending and ascending indexes, case-sensitive and insensitive indexes for string fields. - Shareable in-memory tables. SQLMemTable supports simultaneous access to a table by multiple TSQLMemTable components within a single application. - Default values support. - Record-level constraints, i.e. constraints that must be met when editing the data. Compatibility. - SQLMemTable supports most of TTable field data types, including BLOB fields, moreover it allows to create string and wide string fields of any fixed length. - SQLMemTable is fully compatible with standard DB-aware visual controls such as QuickReport, DBGrid, DBNavigator, DBImage, DBMemo, DBRichEdit, as well as with third party vendor‘s products supporting TDataset descendant components - FastReport, DBFlyTreeView and others. - Calculated and lookup fields can be used in the same way as TTable. - Most of TTable functions are supported including Key and Range methods. Convenience. - Table restructuring is being performed in the easiest way keeping all the existing data. - Data importing from and exporting to any dataset is supported. SQLMemTable provides you with the simplest way to import and export tables using ImportTable and ExportTable methods. - Internationalization / localization support. All text search and sorting functions use current system locale, so localizing your program with SQLMemTable is a very simple task. - Unicode support. All the text operations work with multi-byte encoding using ftWideString. - Comprehensive help. SQLMemTable comes with full documentation presented in SQLMemTable Developer‘s Guide and SQLMemTable Reference. Installation------------1) Make sure that all copies of Delphi (or C++ Builder) are currently closed and not running on the target system. Also, if you are replacing an existing version of SQLMemTable, please remove all files and the package of the prior version before running the new setup program.2) Unpack zip archive containing SQLMemTable into any directory. 3) Run the INSTALL.EXE from this directory.4) Follow on-screen instructions of step-by-step setup wizard to install SQLMemTable.5) If after the installation SQLMemTable components don‘t appear in Components Palette of the IDE, please follow the next instructions: * From the IDE, select ‘Component | Install Packages...‘. * Click the ‘Add‘ button. * In the ..SQLMemTableLibDelphi# (or ..SQLMemTableLibC++ Builder#) directory, select the dclSQLMemTableD#.BPL (or dclSQLMemTableB#.BPL) file. * Click the ‘OK‘ button to close the dialog. * Finally, select ‘Tools | Environment Options‘ from the main menu. From this dialog, select the ‘Library‘ tab and insure that the ..SQLMemTableLibDelphi# (or ..SQLMemTableLibC++ Builder#) directory is included in the ‘Library Path‘ line.Purchasing / Registration-------------------------Visit our site http://www.aidaim.com to purchase or register the product.Copyright and license---------------------See "license.txt" file.Warranty and guarantee----------------------See "license.txt" file.Technical support-----------------Before you contact us, please do the following: - Make sure you have performed all the required steps correctly. - Look at the Help files and Demos: it may already contain an answer to your question. A lot of people ask us something like "how do I:", though the complete information is there. - Visit our Internet site at http://www.aidaim.com. It‘s a good chance that you‘ll find the newer version of our product there.If the problem persists, please, inform us about the following: - SQLMemTable version. - Where did you obtain SQLMemTable (http or ftp site). - Compiler information: Delphi or C++ Builder, Version, Edition, Service Pack - Environmental information: your OS and Service Pack - Description of your problem (as much information as possible to retrieve the problem). - Attach a test project where the problem could be reproduced (it helps us to solve your issue as soon as possible)Typically AidAim Software Support Team answer messages in 24 hours, but depending on singularity and difficulty of your question it may take a bit longer.Should you have any ideas on improving the existing functions of this product after you have downloaded and used it, be easy to e-mail us. All registered users who buy this product may also send their offers to add new possibilities and/or to change the product‘s functions.We consider any ideas and we may take them into account while creating new versions of our products.Other products AidAim Software recommended-------------------------------------------All the products in this chapter are fully compatible with SQLMemTable and recommended to work with our product. AidAim Software had tested all these products released by our partner companies for complete compatibility with SQLMemTable. In its turn, all the partner companies have carried out similar testing of the compatibilityof SQLMemTable with their own products. All the companies whose products present here are technology partners of AidAim Software. It means that both partner companies guarantee the correct joint work of the products. In case of encountering bugs in the time of joint work and owing to it, the partners incur the obligation to resolve such problems for their clients for FREE. FastReport Software -------------------Advanced report generators for Delphi and Kylix.Web Site: http://www.fast-report.comFastReport VCL--------------FastReport VCL is reporting tool component for Borland Delphi 2-6 and Borland C++Builder 3-5. It consists of report engine, designer and preview. Some FastReport possibilities are really unique. The generator allows you to create tables, queries and databases in run-time. Built-in dialog designer allows you creation of dialog forms (they can be used for asking some parameters before printing a report). You also able to use built-in Pascal-like interpreter to do rather complex data processing. In spite of power of FastReport, its code is quite small. Probably FastReport is leader in correlation of functionality/size. The FastReport kernel (without designer) adds to your program the small footprint (less than QR3), but its functionality is like in ReportBuilder‘s one.FastReport CLX edition----------------------FastReport CLX edition is powerfull of FastReport for Borland Delphi 6 and Borland Kylix 1-2 for Linux. It use new CLX-library. Do you want to create reports for Linux as well as for Windows? Use FastReport CLX edition!FastReport VCL 2.3 lite-----------------------FreeWare version of FastReport. Imca Systems DevTeam --------------------Imca Systems DevTeam - Flexible and powerful Delphi/C++ Builder/ActiveX trees, grids and editors.Web Site: http://www.9rays.netDBFlyTreeView Suite-------------------Add grid and treeview functionality with a single component. DBFlyTreeView is a fully customizable, data-bound grid and tree view component that allows you to add huge arrays of nodes. OLE drag-and-drop is supported and the component is customizable at both design-time and runtime. DBFlyTreeView supports custom colors, fonts, and alignment for each cell, and you can even create scrollable background wallpapers without creating huge bitmaps.Included: RapidTree, FlyTreeView, PropertiesTree, DBFlyTreeView controls.DBFlyTreeViewPro Suite----------------------Enable your Delphi and C++Builder applications to display and browse hierarchical, table, and list data. DBFlyTreeViewPro Suite is a set of VCL components that are a direct descendent from FlyTreeViewPro. It supports more than 40 types of in place editors plus your custom format. It is data-aware and allows you to draw any array of cells directly to a printer, Metafile, or Bitmap canvas.Included: RapidTree, IsPlugeditor, FlyTreeViewPro, PropertiesTreePro, DBFlyTreeViewPro controls.

5,379

社区成员

发帖
与我相关
我的任务
社区描述
Delphi 开发及应用
社区管理员
  • VCL组件开发及应用社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧