[Last Call] Learn about multicloud storage options and how to improve your company's cloud strategy. Register Now

x
?
Solved

Unicode and ASCII

Posted on 2008-06-19
4
Medium Priority
?
983 Views
Last Modified: 2013-11-25
Hi Experts,
How can I read data from a Excel file using VB6. The data inside the columns are in Arabic. I must read the data as UNICODE, store in a database as UNICODE and while using this data later to send to another application, I must send that as ASCII.

GKH
0
Comment
Question by:harishkg
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
4 Comments
 
LVL 7

Expert Comment

by:Dauhee
ID: 21830684
Can get via VB6 with:


Private mobjExcelApp As Object
Private mobjWkBkMain As Object
Private mobjWkShMain As Object
Private mobjRange As Object

        Set mobjExcelApp = CreateObject("Excel.Application")
        mobjExcelApp.Visible = True
Set mobjWkBkMain = mobjExcelApp.Workbooks.Open("C:\book.xls")
Set mobjWkShMain = mobjWkBkMain.Worksheets("Sheet1")
msgbox mobjWkShMain.Cells(0,0)

mobjWkBkMain.close
set mobjWkBkMain  = nothing
Set mobjWkShMain = nothing
mobjExcelApp.quit
set mobjExcelApp = nothing
0
 

Author Comment

by:harishkg
ID: 21831418
this is how its read from excel, but the message box displays the data as ????
0
 
LVL 10

Accepted Solution

by:
3_S earned 150 total points
ID: 21840044
You can read and store all the data as unicode, but it is not possible to pass it to another application as ASCII, since unicode uses 2 bytes (and ascii 1byte) so you cannot represent each unicode charachter as ascii code)  therefore you get the data represented as ???
Standard messagebox uses ascii characterset so you get ??? for unicode characters.
0
 
LVL 7

Expert Comment

by:Dauhee
ID: 21840381
yep 3_S ya got it there!!
0

Featured Post

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction While answering a recent question about filtering a custom class collection, I realized that this could be accomplished with very little code by using the ScriptControl (SC) library.  This article will introduce you to the SC library a…
The debugging module of the VB 6 IDE can be accessed by way of the Debug menu item. That menu item can normally be found in the IDE's main menu line as shown in this picture.   There is also a companion Debug Toolbar that looks like the followin…
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…
Suggested Courses

650 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question