มีน้องถามมาถึงเรื่อง การเปิดไฟล์ CSV หรือ XLS excel ไฟล์ ด้วย PowerBuilder ครับ ประมาณว่า กดปุ่มเพื่อเปิดไฟล์ที่ต้องการ ขึ้นมาดูข้อมูล
วิธีการง่ายๆ คือเอา OLE object เข้ามาช่วยดังตัวอย่าง
oleobject ole_obj
ole_obj = create oleobject
ole_obj.ConnectToNewObject("excel.application")
ole_obj.visible = 1
ole_obj.workbooks.Open("g:\filename.xls")
ole_obj.DisconnectObject()
ลองทดสอบกันดูนะ
Credit :: http://www.thaipbl.com/component/content/article/43-pbfunction/180-openexcelfile.html
[ --------- m-Knowledge Collection --------- ]
บันทึกปัญหาจากการทำงานและวิธีการแก้ไข . . . . . . . . . . . . . . . . . . . รวบรวมเรื่องราวความรู้ต่าง ๆ ที่น่าสนใจ
วันอาทิตย์ที่ ๒๔ เมษายน พ.ศ. ๒๕๕๔
วันพุธที่ ๑ ธันวาคม พ.ศ. ๒๕๕๓
General SQL error : SQL0290N Table space access is not allowed. SQLSTATE=55039
เกิดปัญหาในระบบงานศูนย์บริการขึ้น โดยที่เมื่อ "บันทึก" ข้อมูลจะขึ้น Error (ตามรูปที่ 1)
รูปที่ 1
และเมื่อเข้าไปดูที่ Control Center -> Table Spaces พบว่า
Table Spaces ชื่อ USERSPACE1 มี State เป็น "Quiesced Share"
ซึ่ง Table Spaces ตัวอื่นจะเป็น Normal (ตามรูปที่ 2)
รูปที่ 2
---------------------------
SQL0290N
Table space access is not allowed.
http://publib.boulder.ibm.com/infocenter/db2luw/v9r5/index.jsp?topic=/com.ibm.db2.luw.messages.sql.doc/doc/msql00290n.html
สำ ห รั บ วิ ธี แ ก้ ไ ข มี ดั ง นี้
==================
( Users : db2admin )
http://publib.boulder.ibm.com/infocenter/db2luw/v8/index.jsp?topic=/com.ibm.db2.udb.doc/core/r0002003.htm
QUIESCE TABLESPACES FOR TABLE Command
Quiesces table spaces for a table. There are three valid quiesce modes: share, intent to update, and exclusive. There are three possible states resulting from the quiesce function: QUIESCED SHARE, QUIESCED UPDATE, and QUIESCED EXCLUSIVE.
Command syntax
1. Connect to the database with the same user ID used when the quiesce mode was set.
2. Use the LIST TABLESPACES command to determine which table space is quiesced.
3. Re-quiesce the table space using the current quiesce state. For example: db2 quiesce tablespaces for table mytable exclusive
"General SQL error.
[IBM][CLI Driver][DB2/NT] SQL0290N Table space access is
not allowed. SQLSTATE=55039"

และเมื่อเข้าไปดูที่ Control Center -> Table Spaces พบว่า
Table Spaces ชื่อ USERSPACE1 มี State เป็น "Quiesced Share"
ซึ่ง Table Spaces ตัวอื่นจะเป็น Normal (ตามรูปที่ 2)

SQL0290N
Table space access is not allowed.
http://publib.boulder.ibm.com/infocenter/db2luw/v9r5/index.jsp?topic=/com.ibm.db2.luw.messages.sql.doc/doc/msql00290n.html
สำ ห รั บ วิ ธี แ ก้ ไ ข มี ดั ง นี้
==================
( Users : db2admin )
http://publib.boulder.ibm.com/infocenter/db2luw/v8/index.jsp?topic=/com.ibm.db2.udb.doc/core/r0002003.htm
QUIESCE TABLESPACES FOR TABLE Command
Quiesces table spaces for a table. There are three valid quiesce modes: share, intent to update, and exclusive. There are three possible states resulting from the quiesce function: QUIESCED SHARE, QUIESCED UPDATE, and QUIESCED EXCLUSIVE.
Command syntax
>>-QUIESCE TABLESPACES FOR TABLE--+-tablename--------+----------> '-schema.tablename-'>--+-SHARE------------+---------------------------------------->< +-INTENT TO UPDATE-+ +-EXCLUSIVE--------+ '-RESET------------'
Example
------------
"db2 quiesce tablespaces for table staff
share"
"db2 quiesce tablespaces for table boss.org
intent to update""db2 quiesce tablespaces for table mytable exclusive"
To remove a phantom quiesce:
1. Connect to the database with the same user ID used when the quiesce mode was set.
2. Use the LIST TABLESPACES command to determine which table space is quiesced.
3. Re-quiesce the table space using the current quiesce state. For example: db2 quiesce tablespaces for table mytable exclusive
การหา่ว่า Table ไหนที่ติด State "Quiesced"
------------------------------------------------------------------
"DB2 LIST TABLESPACES SHOW DETAIL"
Number of quiescers = 1
Quiescer 1:
Tablespace ID = 2
Object ID = 3
การหา Object ID ( TableID )
--------------------------------
SYSCAT.TABLES catalog view
Column : TABLEID = Object ID
=> TABNAME = ชื่อ Table
< - - - - To experience success .. good luck - - - - >
ป้ายกำกับ:
ศูนย์บริการ,
Database,
DB2,
Error,
HiPROFit
วันพุธที่ ๔ พฤศจิกายน พ.ศ. ๒๕๕๒
แก้ปัญหาพิมพ์ Express XP5 ไม่ได้ใน WinXP
To use the Net.exe command
where x is the number of the LPT port that you are using (usually 1 or 2), printserver is the name of your print server, and sharename is the name of the printer share.
Note To disconnect a persistent LPT connection, type the following at a command prompt: net use lptx /delete
by Little Bear http://softganz.com/paper/19
- Click Start, point to All Programs, point to Accessories, and then click Command Prompt.
- At the command prompt, type
where x is the number of the LPT port that you are using (usually 1 or 2), printserver is the name of your print server, and sharename is the name of the printer share.
Note To disconnect a persistent LPT connection, type the following at a command prompt: net use lptx /delete
by Little Bear http://softganz.com/paper/19
ป้ายกำกับ:
บัญชี,
ศูนย์บริการ,
Express
วันพฤหัสบดีที่ ๕ กุมภาพันธ์ พ.ศ. ๒๕๕๒
ORA-12638: Credential retrieval failed
ORA-12638: Credential retrieval failed
วิธีแก้ไข คือ แก้ข้อมูลที่ไฟล์ sqlnet.ora เปลี่ยนจาก
SQLNET.AUTHENTICATION_SERVICES= (NTS)
เป็น
SQLNET.AUTHENTICATION_SERVICES= (NONE)
วิธีแก้ไข คือ แก้ข้อมูลที่ไฟล์ sqlnet.ora เปลี่ยนจาก
SQLNET.AUTHENTICATION_SERVICES= (NTS)
เป็น
SQLNET.AUTHENTICATION_SERVICES= (NONE)
วันพฤหัสบดีที่ ๓๐ ตุลาคม พ.ศ. ๒๕๕๑
วันพฤหัสบดีที่ ๔ กันยายน พ.ศ. ๒๕๕๑
วันพฤหัสบดีที่ ๒๔ กรกฎาคม พ.ศ. ๒๕๕๑
สมัครสมาชิก:
บทความ (Atom)