473,395 Members | 1,623 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,395 software developers and data experts.

How to IMPORT MS EXCEL worksheet in Kanji (Japanese) to db2/400

Hi all,

Please guide me, I am involved in migration of some of the Excel files of MS EXCEL ( Japanese - Kanji ) into DB2/400.

I am new to this env so If I am asking foolish question, forgive me!

Regards
Jai
Aug 20 '07 #1
2 4335
docdiesel
297 Expert 100+
Hi Jai,

I'm not familiar with DB2 on AS/400, but if I had to copy the data into my DB2 on Linux, I'd do something like the following:
  1. Create a new DB on the AS/400 using UTF as Charset (need UTF-16 for Kanji?)
  2. Install a DB2 runtime client on my PC
  3. Catalog the remote db on my PC as ODBC source
  4. Tell my Excel sheet to refer to a table in the remote db (via odbc)
  5. Copy/paste via Excel the data from source sheet to destination table, or maybe use a macro

Regards,

Bernd
Aug 20 '07 #2
kotiaj
1
How to Import Data from Excel into AS/400?

Import Excel to Datagrid first(SQL):
Dim str As String = ""
str = " Provider = Microsoft.Jet.OLEDB.4.0;"
str = str & " Data Source = " & Trim(Me.txtFileName.Text) & ";"
str = str & " Extended Properties=Excel 8.0;"
con = New OleDbConnection(str)
con.Open()
cmd = New OleDbCommand("select * from [sheet1$] ", con)
dr = cmd.ExecuteReader
Me.grdImportDoc.Rows.Clear()
If dr.HasRows Then
While dr.Read
'Me.grdImportDoc.Rows.Add(dr("#"), dr("#"), dr(""), dr(""), dr("COST/M"), dr("QUANTITY"))
If dr(0).ToString = "" Then
Exit While
End If
Me.grdImportDoc.Rows.Add(dr(0), dr(1), dr(2), dr(3), dr(4), dr(5))
End While
End If


Save to AS/400:
If grdImportDoc.Rows.Count = 0 Then
MsgLbl.Text = "Please import data in grid"
Else
For T = 0 To grdImportDoc.Rows.Count - 1
var1 = Trim(grdImportDoc.Rows(T).Cells(0).Value & "")
var2 = Trim(grdImportDoc.Rows(T).Cells(1).Value & "")
var3 = Trim(grdImportDoc.Rows(T).Cells(2).Value & "")
var4 = Trim(grdImportDoc.Rows(T).Cells(3).Value & "")
var5 = Convert.ToDecimal(grdImportDoc.Rows(T).Cells(4).Va lue & "")
var6 = Convert.ToInt32(grdImportDoc.Rows(T).Cells(5).Valu e & "")
ds = New DataSet
AScon = New OdbcConnection(AS400Str)
MsgLbl.Text = "Records in processing"
AScon.Open()
AScmd = New OdbcCommand("insert into Severname.Lib name.File name (Fields) values ('" & var1 & "','" & var2 & "','" & var3 & "','" & var4 & "'," & var5 & "," & var6 & ")", AScon)
AScmd.ExecuteNonQuery()
Next
MsgLbl.Text = "Records are added successfully in AS400"
AScon.Close()
End If
Aug 30 '07 #3

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

Similar topics

3
by: Fabian | last post by:
I have a page (ok, will have a page) written in Japanese. As we all know, Japanese is written with some pretty funky characters, and it is conventional to write the so-called furigana above these...
8
by: Nick M | last post by:
Hello All, Excellent info here Thanks! I am very new to using access in general and I am on a learning curve. I'm trying to import an excel workbook (with worksheets) into an access db via a...
3
by: wylie72 | last post by:
I export a recordset to excel via VB code (see code below). My problem is the date fields import as an integer into excel (11/14/05 becomes 38670). How do I go about addressing this? Public...
9
by: tomrmgc | last post by:
Here is the problem we've encountered. An application that used to successfully display Japanese Kanji characters no longer does so when recompiled with 7.1 When compiled with the 6.0 compiler,...
0
by: Jedawi | last post by:
Hi, would anyone be able to point me in the right direction on how to import an image (.jpg file) into an Excel worksheet using VB.Net and Option Strict On. This should be straight forward...
1
by: Peter Stojkovic | last post by:
I am importing data from an EXCEL XLS-File via OLEDB-Provider The command is SELECT * from Everything works fine if the first sheet is named sheet1 But sometimes the name is not known...
1
by: Tammy Viola | last post by:
I would like to import an Excel Worksheet as a new table in the backend of an Access database. Looked at using docmd.TransferSpreadsheet without success. Also looked at creating a table using...
1
by: baling | last post by:
Hi.... Hi everybody, i have a code that i make in VBA and know I want to use this code in to VB6. But i don't know how to use that code in to VB 6.0 Please correct this code so i can use it in VB...
7
by: TG | last post by:
hi! I am trying to create a sql server table from an excel sheet. Here is the code I have: 'This procedure the xlsx file and dumps it to a table in SQL Server
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
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: 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:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
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
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
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...

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.