AVCHD (Advanced Video Codec High Definition) เป็นไฟล์วิดีโอความละเอียดสูง ซึ่งเรามักเห็นกันในแผ่น DVD หรือสื่อบันทึกข้อมูลอื่นๆ พวกกล้องวิดีโอ คุณภาพนั้นก็ด้อยกว่าภาพ Blu-ray ไม่เท่าไหร่ครับ แต่จุดเด่นที่ชัดเจนกว่าคือขนาดไฟล์ที่มีขนาดเล็ก เพราะใช้การเข้ารหัสไฟล์แบบ MPEG-4 AVC (H.264) ทำให้สามารถบรรจุหนังความละเอียดสูงลงแผ่น DVD5 เพียงแผ่นเดียวเท่านั้น
อย่างไรก็ตามแม้มีข้อดีแต่ก็มีข้อด้อยอยู่เหมือนกัน กล่าวคือหากนำแผ่นดังกล่าวมาเล่นในคอมพิวเตอร์ หรือเครื่องเล่นที่ไม่ได้มีตัวถอดรหัสโดยเฉพาะก็จะเล่นไม่ได้ การเล่นในคอมพิวเตอร์นั้น เราสามารถซิกแซกได้ด้วยการเข้าไปเปิดไฟล์โดยตรงที่โฟลเดอร์ [ไดรฟ์]:\BDMV\STREAM โดยไฟล์ที่อยู่ในโฟลเดอร์นั้นจะเป็นไฟล์นามสกุล m2ts เราเพียงลากไฟล์ดังกล่าวมาวางบนหน้าต่างโปรแกรม KMPlayer ก็เล่นได้แล้ว และเพื่อความสะดวกยิ่งขึ้น ควรแปลงไฟล์ดังกล่าวเป็นไฟล์แบบ MKV ด้วยวิธีการดังนี้ครับ
หมายเหตุ
วิธีการทำนี้อาจจะกล่าวได้ว่าไม่ได้เป็นการแปลงเนื้อในภาพวิดีโอ เพียงแต่เปลี่ยนการเปลี่ยนเสื้อผ้า ซึ่งจะใช้เวลาในการทำรวดเร็วมากประมาณ 2 –3 นาทีก็เสร็จแล้ว (ทดสอบจากฮาร์ดดิสก์แบบ Raid 0 หนังหนึ่งเรื่องใช้เวลา 106 วินาที)
ใช้โปรแกรมในการทำ 2 โปรแกรมคือ
tsMuxeR [url= http://www.videohelp.com/tools/tsMuxeR ]download[/url]
mkvmerge GUI http://www.videohelp.com/tools/MKVtoolnix
1. เปิดโปรแกรม tsMuxeR ขึ้นมาดังรูปด้านล่างนี้ คลิกปุ่ม Add
2. คลิกเลือกนำไฟล์ m2ts ที่อยู่ในโฟลเดอร์ [ไดรฟ์]:\BDMV\STREAM เข้ามาในโปรแกรม
3. เมื่อนำไฟล์เข้ามาในโปรแกรมเสร็จแล้ว คลิกเลือก Demux เพื่อทำการแยกไฟล์ภาพ และไฟล์เสียงออกมาจากไฟล์ m2ts
4. คลิกปุ่ม Browse เลือกตำแหน่งสำหรับบันทึกไฟล์
5. คลิกปุ่ม Start Demuxing โปรแกรมจะเริ่มการแยกไฟล์ภาพและเสียงออกให้ทันที
ไฟล์ภาพที่แยกได้ตามตัวอย่างนี้ นามสกุล .264 ส่วนไฟล์เสียงนามสกุล .dts (เป็นเสียงแบบ DTS)
6. เปิดโปรแกรม mkvmerge GUI ขึ้นมา คลิกปุ่ม Add เพื่อนำไฟล์ภาพและเสียงที่แยกเสร็จแล้ว เข้ามาในโปรแกรม
7. คลิกเลือกบรรทัดของไฟล์ภาพ และคลิกที่แท็บ Format specific options เพื่อกำหนดค่า FPS (เฟรมเรท) ของภาพ หากคุณไม่กำหนดตัวโปรแกรมจะใช้ค่ามาตรฐานคือ 25 FPS ตามตัวอย่างนี้ภาพวิดีโอของผมมี FPS: 23.976
ถ้าคุณอยากจะรู้ว่าเฟรมเรทของภาพคุณเท่าไหร่ กดปุ่ม alt + j ระหว่างที่เล่นไฟล์ผ่านโปรแกรม KMPlayer นะครับ จะมีรายละเอียดแสดงขึ้นมาให้เห็น
8. คลิกปุ่ม Browse เลือกตำแหน่งสำหรับบันทึกไฟล์ จากนั้นก็คลิกปุ่ม Start musing โปรแกรมจะรวมไฟล์ภาพและเสียง ให้กลายเป็นไฟล์ mkv ทันที
วันจันทร์ที่ 10 มกราคม พ.ศ. 2554
MKV 2 Blue-ray
หลังจากเขียนบทความ แปลงไฟล์ในแผ่น AVCHD (m2ts) เป็นไฟล์ MKV คราวนี้เรามาแปลงไฟล์ MKV กลับไปบ้าง ถ้าหากคุณมีไฟล์แบบ MKV อยากจะแปลงกลับไปเป็น AVCHD (m2ts) เพื่อบันทึกลงแผ่น DVD5 หรือ Blu-ray (คุณต้องมีแผ่น Blu-ray และเครื่องไรท์ด้วยนะครับ) เพื่อนำไปเล่นในเครื่องเล่น ก็ทำด้วยด้วยวิธีการในบทความนี้ครับ
วิธีการทำต้องอาศัยโปรแกรม
tsMuxeR http://www.videohelp.com/tools/tsMuxeR
โดยมีขั้นตอนการทำดังนี้
1. คลิกปุ่ม Add เพื่อนำไฟล์ mkv เข้ามาในโปรแกรม
2. คลิกเลือกรูปแบบไฟล์ที่จะทำ Blu-ray disk หรือ AVCHD disk ก็เลือกตามต้องการได้เลยครับ
3. คลิกปุ่ม Browse เพื่อกำหนดตำแหน่งสำหรับบันทึกไฟล์
4. คลิกปุ่ม Start muxing โปรแกรมจะเริ่มสร้างไฟล์ให้ทันที
###จบแล้วครับ##
วิธีการทำต้องอาศัยโปรแกรม
tsMuxeR http://www.videohelp.com/tools/tsMuxeR
โดยมีขั้นตอนการทำดังนี้
1. คลิกปุ่ม Add เพื่อนำไฟล์ mkv เข้ามาในโปรแกรม
2. คลิกเลือกรูปแบบไฟล์ที่จะทำ Blu-ray disk หรือ AVCHD disk ก็เลือกตามต้องการได้เลยครับ
3. คลิกปุ่ม Browse เพื่อกำหนดตำแหน่งสำหรับบันทึกไฟล์
4. คลิกปุ่ม Start muxing โปรแกรมจะเริ่มสร้างไฟล์ให้ทันที
###จบแล้วครับ##
วันพุธที่ 27 ตุลาคม พ.ศ. 2553
thumbnail icon size windows xp
This simple tutorial will walk you through the steps to configure you thumbnails to be bigger than the default size. Alternatively, you could make them smaller as well, if you would like to fit more on a page but still have the thumbnail view. This will only change it for one user as well, so if other people use your machine, it will not affect them. Keep in mind that if the thumbnails are getting made bigger than they should they may distort after a certain size. Let’s get started.
This is the default size of the thumbnail images in windows XP.
We will be modifying the registry to make this change. To open the registry editor, click on Start and select Run (Please note that my start menu says TeamTutorials instead of “start” – Learn how to change that by following http://teamtutorials.com/windows-tutorials/changing-your-start-button-text)
Type in “regedit” (without the quotes) and press enter to launch the Registry Editor.
This is the default view of the registry. Click the expand button (the plus signs) next to the proper keys to navigate to the following key:
HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer
Once you are there, click on Explorer instead of click the expand sign in the left pane and the right pane will fill up with keys.
You editor should now look like the above picture. Look for a key called ThumbnailSize. If one does not exist (like the picture above) we will need to create it. If it does exist you can skip this step.
Right-click on any whitespace located in the right pane, hover over new, and select DWORD Value. This will create a key in the right pane. Name it ThumbnailSize. Make sure you have no spaces in the name.
Once you double-click on the value a box will pop up that looks like the picture above. You can now enter the value you wish to use. You can select either decimal or hexadecimal, doesn’t really matter, except the number limits are different. If you are using decimal, the number can be 32 (smallest) to 256 (largest) which converts to 20 (smallest) and 100 (largest) if you are using hexadecimal. You can now close out of your windows you have open and check your work.
Smallest:
Hex – 20
Decimal – 32
Windows Default:
Hex – 64
Decimal – 100
Largest:
Hex – 100
Decimal – 256
This concludes this tutorial. I hope you were able to follow it with little trouble. Please comment with problems and suggestions for new tutorials. Thank you for reading.
This is the default size of the thumbnail images in windows XP.
We will be modifying the registry to make this change. To open the registry editor, click on Start and select Run (Please note that my start menu says TeamTutorials instead of “start” – Learn how to change that by following http://teamtutorials.com/windows-tutorials/changing-your-start-button-text)
Type in “regedit” (without the quotes) and press enter to launch the Registry Editor.
This is the default view of the registry. Click the expand button (the plus signs) next to the proper keys to navigate to the following key:
HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer
Once you are there, click on Explorer instead of click the expand sign in the left pane and the right pane will fill up with keys.
You editor should now look like the above picture. Look for a key called ThumbnailSize. If one does not exist (like the picture above) we will need to create it. If it does exist you can skip this step.
Right-click on any whitespace located in the right pane, hover over new, and select DWORD Value. This will create a key in the right pane. Name it ThumbnailSize. Make sure you have no spaces in the name.
Once you double-click on the value a box will pop up that looks like the picture above. You can now enter the value you wish to use. You can select either decimal or hexadecimal, doesn’t really matter, except the number limits are different. If you are using decimal, the number can be 32 (smallest) to 256 (largest) which converts to 20 (smallest) and 100 (largest) if you are using hexadecimal. You can now close out of your windows you have open and check your work.
Smallest:
Hex – 20
Decimal – 32
Windows Default:
Hex – 64
Decimal – 100
Largest:
Hex – 100
Decimal – 256
This concludes this tutorial. I hope you were able to follow it with little trouble. Please comment with problems and suggestions for new tutorials. Thank you for reading.
วันพฤหัสบดีที่ 21 ตุลาคม พ.ศ. 2553
Alternate Row Color in Crystal Report
Most of the time while developing reports people wonder how to have alternating row colors in the report like below.
Customer Name Address City State Zip
Suparba panda 123 olive rd St Louis MO 54678
John Doe 456 Tree drive Raleigh NC 14676
Jane Doe 768 Hudson rd Atlanta GA 76555
There is a cool trick to it.
Go to the format section of the Details. Click the Color Tab. Then click the button next to the Background Color CheckBox..
In the formula editor of background color, type the following:
if RecordNumber mod 2 = 0 then crSilver else crNoColor
Save and close the editor.
And now when you run the report you will see alternate colors of silver and white in the details section.
Conclusion
Customer Name Address City State Zip
Suparba panda 123 olive rd St Louis MO 54678
John Doe 456 Tree drive Raleigh NC 14676
Jane Doe 768 Hudson rd Atlanta GA 76555
There is a cool trick to it.
Go to the format section of the Details. Click the Color Tab. Then click the button next to the Background Color CheckBox..
In the formula editor of background color, type the following:
if RecordNumber mod 2 = 0 then crSilver else crNoColor
Save and close the editor.
And now when you run the report you will see alternate colors of silver and white in the details section.
Conclusion
วันอังคารที่ 19 ตุลาคม พ.ศ. 2553
SQL Server::Cursor::ทำความรู้จักกับ Cursorsubject
SQL Server::Cursor::ทำความรู้จักกับ Cursorsubject:ทำความรู้จักกับ Cursorcontent:Cursor ใช้เพื่อเข้าถึงกลุ่มผลลัพธ์ ( ResultSet ) และสามารถทำสิ่งต่างๆต่อไปนี้ได้
1) สามารถเข้าถึงตำแหน่ง Record ของกลุ่มผลลัพธ์ได้
2) สามารถดึงข้อมูลจาก Column ของ Record ที่ชี้อยู่ได้
3) สามารถเปลี่ยนแปลงแก้ไขข้อมูลใน Record ที่ชี้อยู่ได้SQL Server::Cursor::ขั้นตอนการสร้าง Cursorsubject:ขั้นตอนการสร้าง Cursorcontent:ขั้นตอนการสร้าง Cursor ดังนี้
1) ประกาศ Cursor
2) เปิด Cursor
3) เข้าถึง Record ข้อมูลด้วย Cursor
4) ปิด Cursor
5) คืนทรัพยากรที่ถูกใช้โดย Cursorexample:DECLARE @person_id int
DECLARE @person_firstname varchar(200)
DECLARE @person_lastname varchar(200)
DECLARE @person_sex int
DECLARE cur_person CURSOR FOR SELECT id, firstname, lastname, sex FROM person
OPEN cur_person
FETCH NEXT FROM cur_person INTO @person_id, @person_firstname, @person_lastname, @person_sex
PRINT 'ID : ' + @person_id
PRINT 'NAME : ' + @person_firstname + ' ' + @person_lastname
PRINT 'SEX : ' + @person_sex
CLOSE cur_person
DEALLOCATE cur_personSQL Server::Cursor::DECLARE CURSORsubject:DECLARE CURSORsyntax:DECLARE cursor_name [ INSENSITIVE ] [ SCROLL ] CURSOR
FOR
[ FOR { READ ONLY | UPDATE [ OR column1 [, columnN ] ] } ]content:ใช้ในการประกาศ Cursor
> โดย INSENSITIVE เป็นการกำหนดให้สร้างเป็นตารางชั่วคราวแยกต่างหากไว้ในฐานข้อมูลระบบ tempdb
ดังนั้นการแก้ไขข้อมูลจากตารางหลัก จะไม่มีผลกับข้อมูลที่เกิดจาก Cursor นี้ และการแก้ไขข้อมูลที่ Cursor
นี้ ไม่สามารถทำได้
> โดย SCROLL เป็นการกำหนดให้สามารถใช้คำสั่ง FIRST, LAST, PRIOR, NEXT, RELATIVE และ ABSOLUTE
เพื่อเข้าถึงแต่ละ Record ของ Cursor ได้ ( ถ้าไม่กำหนดคำสั่งนี้จะใช้ได้เพียง NEXT เท่านั้น )
> โดย สามารถใช้คำสั่ง COMPUTE, COMPUTE BY, FOR BROWSE และ INTO ไม่ได้
> โดย READ ONLY เป็นการกำหนดว่า Cursor นี้สามารถอ่านได้อย่างเดียว
> โดย UPDATE เป็นการกำหนดว่า Cursor นี้สามารถ UPDATE ข้อมูลได้ และ UPDATE คอลัมน์ใดได้บ้าง
ถ้าไม่ระบุ จะหมายถึงสามารถ UPDATE ได้ทุก COLUMNexample:DECLARE @person_id int
DECLARE @person_firstname varchar(200)
DECLARE @person_lastname varchar(200)
DECLARE @person_sex int
DECLARE cur_person CURSOR FOR SELECT id, firstname, lastname, sex FROM person
OPEN cur_person
FETCH NEXT FROM cur_person INTO @person_id, @person_firstname, @person_lastname, @person_sex
PRINT 'ID : ' + @person_id
PRINT 'NAME : ' + @person_firstname + ' ' + @person_lastname
PRINT 'SEX : ' + @person_sex
CLOSE cur_person
DEALLOCATE cur_personSQL Server::Cursor::DECLARE CURSOR [ แบบที่ 2 ]subject:DECLARE CURSOR [ แบบที่ 2 ]syntax:DECLARE cursor_name CURSOR
[ LOCAL | GLOBAL ]
[ FORWARD_ONLY | SCROLL ]
[ STATIC | KEYSET | DYNAMIC | FAST_FORWARD ]
[ READ_ONLY | SCROLL_LOCKS | OPTIMISTIC ]
[ TYPE_WARNING ]
FOR
[ FOR UPDATE [ OR column1 [, columnN ] ] ]content:ใช้ในการประกาศ Cursor โดยปกติ Cursor จะเป็นแบบ GLOBAL
( สามารถเปลี่ยนได้โดย sp_dboption db_name, "default to local cursor", "TRUE" )
> โดย FORWARD_ONLY จะทำให้ใช้ได้แค่คำสั่ง FETCH NEXT เท่านั้น
> โดย SCROLL จะทำให้สามารถใช้คำสั่ง FIRST, LAST, PRIOR, NEXT, RELATIVE และ ABSOLUTE ได้
> โดย STATIC คือเป็นการกำหนดให้สร้างเป็นตารางชั่วคราวแยกต่างหากไว้ในฐานข้อมูลระบบ tempdb
ดังนั้นการแก้ไขข้อมูลจากตารางหลัก จะไม่มีผลกับข้อมูลที่เกิดจาก Cursor นี้ และการแก้ไขข้อมูลที่ Cursor
นี้ ไม่สามารถทำได้
> โดย KEYSET คือหมายความว่า Cursor นี้จะอาศัย Unique Indexes ในการเข้าถึงข้อมูลจริงที่เก็บไว้ในตารางหลัก
ดังนั้นหากมีการเปลี่ยนแปลงข้อมูลในตารางหลักจะทำให้ข้อมูลจาก Cursor ได้รับผลกระทบตามไปด้วย
( ถ้าหาก Table ไม่มี Unique Indexes แล้วก็จะถูกเปลี่ยนไปเป็น STATIC โดยอัตโนมัติ )
> โดย DYNAMIC เป็นการกำหนดว่าหากมีการเปลี่ยนแปลงข้อมูลที่ตารางหลักแล้ว จะมีผลต่อ Cursor ด้วย
จะทำให้ไม่สามารถใช้คำสั่ง FETCH ABSOLUTE ได้ ( วิธีการทำงานของ Cursor นี้นั้น ทุกๆครั้งที่มีการ FETCH
ข้อมูล Cursor จะถูกสร้างใหม่ ทำให้ข้อมูลมีการ UPDATE อยู่เสมอ แต่จะทำให้ใช้ Resource สูงมากตามลำดับ )
> โดย FAST_FORWARD คือจะเข้าถึง Record แรกโดยอัตโนมัติหลังจากเปิด Cursor และจะปิด Cursor
ดยอัตโนมัติทันทีเมื่อเข้าถึง Record สุดท้าย ( ไม่สามารถใช้ได้พร้อมกับคำสั่ง SCROLL, SCROLL_LOCKS,
OPTIMISTIC, FOR UPDATE ได้ )
(
เงื่อนไขของการใช้ FAST_FORWARD ดังนี้
1) เมื่อมีการ Query ระหว่าง 2 ตามรางแล้ว FAST_FORWARD จะถูกเปลี่ยนเป็น STATIC
2) เมื่อมีการ Query โดย Distributed Query แล้ว FAST_FORWARD จะถูกเปลี่ยนเป็น KEYSET
3) เมื่อมีการใช้คีย์เวิร์ด FOR UPDATE แล้ว FAST_FORWARD จะถูกเปลี่ยนแป็น DYNAMIC
4) ถ้า Query มีการอ้างถึง column ที่มีข้อมูลประเภท text, ntext หรือ image แล้ว FAST_FORWARD จะถูกเปลี่ยนเป็น DYNAMIC
5) ถ้า Query มีการอ้างถึง column ที่มีข้อมูลประเภท text, ntext หรือ image และมีคีย์เวิร์ด TOP ด้วย แล้ว FAST_FORWARD จะถูกเปลี่ยนเป็น DYNAMIC
)
> โดย READ_ONLY เป็นการกำหนดให้ Cursor อ่านได้อย่างเดียว
> โดย SCROLL_LOCKS เป็นการ Lock ข้อมูลในตารางจริง เมื่อมีการอ่านมายัง Cursor ทำให้ไม่สามารถแก้ไขข้อมูลในตารางจริงได้
> โดย OPTIMISTIC เป็นการอ่านและบันทึกลงได้ และไม่มีการ Lock ใดๆ
> โดย TYPE_WARNING กำหนดให้มีการแจ้งเตือน หากมีการเปลี่ยนแปลงประเภทของ Cursor ( ที่เปลี่ยนแปลงโดยอัตโนมัติตามเงื่อนไขต่างๆ )
> โดย FOR UPDATE เป็นการกำหนดว่า Cursor นี้สามารถ UPDATE ข้อมูลได้ และ UPDATE คอลัมน์ใดได้บ้าง
ถ้าไม่ระบุ จะหมายถึงสามารถ UPDATE ได้ทุก COLUMNexample:DECLARE @person_id int
DECLARE @person_firstname varchar(200)
DECLARE @person_lastname varchar(200)
DECLARE @person_sex int
DECLARE cur_person CURSOR FOR SELECT id, firstname, lastname, sex FROM person
OPEN cur_person
FETCH NEXT FROM cur_person INTO @person_id, @person_firstname, @person_lastname, @person_sex
PRINT 'ID : ' + @person_id
PRINT 'NAME : ' + @person_firstname + ' ' + @person_lastname
PRINT 'SEX : ' + @person_sex
CLOSE cur_person
DEALLOCATE cur_personSQL Server::Cursor::OPEN cursorsubject:OPEN cursorsyntax:OPEN { { [ GLOBAL ] cursor_name } | cursor_variable_name }content:ใช้ในการเปิด Cursorexample:DECLARE @person_id int
DECLARE @person_firstname varchar(200)
DECLARE @person_lastname varchar(200)
DECLARE @person_sex int
DECLARE cur_person CURSOR FOR SELECT id, firstname, lastname, sex FROM person
OPEN cur_person
FETCH NEXT FROM cur_person INTO @person_id, @person_firstname, @person_lastname, @person_sex
PRINT 'ID : ' + @person_id
PRINT 'NAME : ' + @person_firstname + ' ' + @person_lastname
PRINT 'SEX : ' + @person_sex
CLOSE cur_person
DEALLOCATE cur_personSQL Server::Cursor::FETCH cursorsubject:FETCH cursorsyntax:FETCH
[ [ NEXT | PRIOR | FIRST | LAST | ABSOLUTE n | RELATIVE n ] FROM ]
{ { [ GLOBAL ] cursor_name } | cursor_variable_name }
[ INTO @varname1 [, @varnameN ] ]content:ใช้ในการเข้าถึงข้อมูลของ Cursorexample:DECLARE @person_id int
DECLARE @person_firstname varchar(200)
DECLARE @person_lastname varchar(200)
DECLARE @person_sex int
DECLARE cur_person CURSOR FOR SELECT id, firstname, lastname, sex FROM person
OPEN cur_person
FETCH NEXT FROM cur_person INTO @person_id, @person_firstname, @person_lastname, @person_sex
PRINT 'ID : ' + @person_id
PRINT 'NAME : ' + @person_firstname + ' ' + @person_lastname
PRINT 'SEX : ' + @person_sex
CLOSE cur_person
DEALLOCATE cur_personSQL Server::Cursor::CLOSE cursorsubject:CLOSE cursorsyntax:CLOSE { { [ GLOBAL ] cursor_name } | cursor_variable_name }content:ใช้ในการปิด Cursor
example:DECLARE @person_id int
DECLARE @person_firstname varchar(200)
DECLARE @person_lastname varchar(200)
DECLARE @person_sex int
DECLARE cur_person CURSOR FOR SELECT id, firstname, lastname, sex FROM person
OPEN cur_person
FETCH NEXT FROM cur_person INTO @person_id, @person_firstname, @person_lastname, @person_sex
PRINT 'ID : ' + @person_id
PRINT 'NAME : ' + @person_firstname + ' ' + @person_lastname
PRINT 'SEX : ' + @person_sex
CLOSE cur_person
DEALLOCATE cur_personSQL Server::Cursor::DEALLOCATE cursorsubject:DEALLOCATE cursorsyntax:DEALLOCATE { { [ GLOBAL ] cursor_name } | cursor_variable_name }content:ใช้ในการคืนทรัพยากร ในกรณีที่ไม่ได้ใช้ Cursor นั้นแ้ล้วexample:DECLARE @person_id int
DECLARE @person_firstname varchar(200)
DECLARE @person_lastname varchar(200)
DECLARE @person_sex int
DECLARE cur_person CURSOR FOR SELECT id, firstname, lastname, sex FROM person
OPEN cur_person
FETCH NEXT FROM cur_person INTO @person_id, @person_firstname, @person_lastname, @person_sex
PRINT 'ID : ' + @person_id
PRINT 'NAME : ' + @person_firstname + ' ' + @person_lastname
PRINT 'SEX : ' + @person_sex
CLOSE cur_person
DEALLOCATE cur_personSQL Server::Cursor::@@CURSOR_ROWSsubject:@@CURSOR_ROWSsyntax:@@CURSOR_ROWS content:ถ้าคืนค่า -n เพื่อบอกว่าพบจำนวน n record และจะมากขึ้นเรื่อยๆ เพราะยังโหลดไม่เสร็จ
ถ้าคืนค่า n เพื่อบอกว่าพบจำนวน n record ( เพราะโหลดเสร็จแล้ว )
ถ้าคืนค่า -1 เพื่อบอกว่าเป็นการเปิดแบบ DYNAMIC
ถ้าคืนค่า 0 เพื่อบอกว่ามีจำนวน 0 recordexample:DECLARE @person_id int
DECLARE @person_firstname varchar(200)
DECLARE @person_lastname varchar(200)
DECLARE @person_sex int
DECLARE cur_person CURSOR FOR SELECT id, firstname, lastname, sex FROM person
OPEN cur_person
FETCH NEXT FROM cur_person INTO @person_id, @person_firstname, @person_lastname, @person_sex
WHILE @@FETCH_STATUS = 0
BEGIN
PRINT 'ID : ' + @person_id
PRINT 'NAME : ' + @person_firstname + ' ' + @person_lastname
PRINT 'SEX : ' + @person_sex
FETCH NEXT FROM cur_person INTO @person_id, @person_firstname, @person_lastname, @person_sex
END
CLOSE cur_person
DEALLOCATE cur_personSQL Server::Cursor::@@FETCH_STATUSsubject:@@FETCH_STATUSsyntax:@@FETCH_STATUScontent:ถ้าคืนค่า 0 คือเข้าถึง Record สำเร็จ
ถ้าคืนค่า -1 คือเข้าถึง Record ไม่สามารถกระทำได้ หรือได้ชี้เกิดกลุ่มของผลลัพธ์ไปแล้ว ( EOF )
ถ้าคืนค่า -2 คือการเข้าถึง Record มีความผิดพลาดเกิดขึ้นexample:DECLARE @person_id int
DECLARE @person_firstname varchar(200)
DECLARE @person_lastname varchar(200)
DECLARE @person_sex int
DECLARE cur_person CURSOR FOR SELECT id, firstname, lastname, sex FROM person
OPEN cur_person
FETCH NEXT FROM cur_person INTO @person_id, @person_firstname, @person_lastname, @person_sex
WHILE @@FETCH_STATUS = 0
BEGIN
PRINT 'ID : ' + @person_id
PRINT 'NAME : ' + @person_firstname + ' ' + @person_lastname
PRINT 'SEX : ' + @person_sex
FETCH NEXT FROM cur_person INTO @person_id, @person_firstname, @person_lastname, @person_sex
END
CLOSE cur_person
DEALLOCATE cur_personSQL Server::Cursor::ตัวอย่างการ UPDATE ข้อมูล ณ ตำแหน่งที่ Cursor ชี้อยู่subject:ตัวอย่างการ UPDATE ข้อมูล ณ ตำแหน่งที่ Cursor ชี้อยู่example:UPDATE table_name
SET column_name = value
WHERE CURRENT OF { { [ GLOBAL ] cursor_name } | cursor_variable_name }
UPDATE person
SET sex = 2
WHERE CURRENT OF cur_personSQL Server::Cursor::ตัวอย่างการ DELETE ข้อมูล ณ ตำแหน่งที่ Cursor ชี้อยู่subject:ตัวอย่างการ DELETE ข้อมูล ณ ตำแหน่งที่ Cursor ชี้อยู่example:DELETE table_name
WHERE CURRENT OF { { [ GLOBAL ] cursor_name } | cursor_variable_name }
DELETE person
WHERE CURRENT OF cur_person
1) สามารถเข้าถึงตำแหน่ง Record ของกลุ่มผลลัพธ์ได้
2) สามารถดึงข้อมูลจาก Column ของ Record ที่ชี้อยู่ได้
3) สามารถเปลี่ยนแปลงแก้ไขข้อมูลใน Record ที่ชี้อยู่ได้SQL Server::Cursor::ขั้นตอนการสร้าง Cursorsubject:ขั้นตอนการสร้าง Cursorcontent:ขั้นตอนการสร้าง Cursor ดังนี้
1) ประกาศ Cursor
2) เปิด Cursor
3) เข้าถึง Record ข้อมูลด้วย Cursor
4) ปิด Cursor
5) คืนทรัพยากรที่ถูกใช้โดย Cursorexample:DECLARE @person_id int
DECLARE @person_firstname varchar(200)
DECLARE @person_lastname varchar(200)
DECLARE @person_sex int
DECLARE cur_person CURSOR FOR SELECT id, firstname, lastname, sex FROM person
OPEN cur_person
FETCH NEXT FROM cur_person INTO @person_id, @person_firstname, @person_lastname, @person_sex
PRINT 'ID : ' + @person_id
PRINT 'NAME : ' + @person_firstname + ' ' + @person_lastname
PRINT 'SEX : ' + @person_sex
CLOSE cur_person
DEALLOCATE cur_personSQL Server::Cursor::DECLARE CURSORsubject:DECLARE CURSORsyntax:DECLARE cursor_name [ INSENSITIVE ] [ SCROLL ] CURSOR
FOR
[ FOR { READ ONLY | UPDATE [ OR column1 [, columnN ] ] } ]content:ใช้ในการประกาศ Cursor
> โดย INSENSITIVE เป็นการกำหนดให้สร้างเป็นตารางชั่วคราวแยกต่างหากไว้ในฐานข้อมูลระบบ tempdb
ดังนั้นการแก้ไขข้อมูลจากตารางหลัก จะไม่มีผลกับข้อมูลที่เกิดจาก Cursor นี้ และการแก้ไขข้อมูลที่ Cursor
นี้ ไม่สามารถทำได้
> โดย SCROLL เป็นการกำหนดให้สามารถใช้คำสั่ง FIRST, LAST, PRIOR, NEXT, RELATIVE และ ABSOLUTE
เพื่อเข้าถึงแต่ละ Record ของ Cursor ได้ ( ถ้าไม่กำหนดคำสั่งนี้จะใช้ได้เพียง NEXT เท่านั้น )
> โดย
> โดย READ ONLY เป็นการกำหนดว่า Cursor นี้สามารถอ่านได้อย่างเดียว
> โดย UPDATE เป็นการกำหนดว่า Cursor นี้สามารถ UPDATE ข้อมูลได้ และ UPDATE คอลัมน์ใดได้บ้าง
ถ้าไม่ระบุ จะหมายถึงสามารถ UPDATE ได้ทุก COLUMNexample:DECLARE @person_id int
DECLARE @person_firstname varchar(200)
DECLARE @person_lastname varchar(200)
DECLARE @person_sex int
DECLARE cur_person CURSOR FOR SELECT id, firstname, lastname, sex FROM person
OPEN cur_person
FETCH NEXT FROM cur_person INTO @person_id, @person_firstname, @person_lastname, @person_sex
PRINT 'ID : ' + @person_id
PRINT 'NAME : ' + @person_firstname + ' ' + @person_lastname
PRINT 'SEX : ' + @person_sex
CLOSE cur_person
DEALLOCATE cur_personSQL Server::Cursor::DECLARE CURSOR [ แบบที่ 2 ]subject:DECLARE CURSOR [ แบบที่ 2 ]syntax:DECLARE cursor_name CURSOR
[ LOCAL | GLOBAL ]
[ FORWARD_ONLY | SCROLL ]
[ STATIC | KEYSET | DYNAMIC | FAST_FORWARD ]
[ READ_ONLY | SCROLL_LOCKS | OPTIMISTIC ]
[ TYPE_WARNING ]
FOR
[ FOR UPDATE [ OR column1 [, columnN ] ] ]content:ใช้ในการประกาศ Cursor โดยปกติ Cursor จะเป็นแบบ GLOBAL
( สามารถเปลี่ยนได้โดย sp_dboption db_name, "default to local cursor", "TRUE" )
> โดย FORWARD_ONLY จะทำให้ใช้ได้แค่คำสั่ง FETCH NEXT เท่านั้น
> โดย SCROLL จะทำให้สามารถใช้คำสั่ง FIRST, LAST, PRIOR, NEXT, RELATIVE และ ABSOLUTE ได้
> โดย STATIC คือเป็นการกำหนดให้สร้างเป็นตารางชั่วคราวแยกต่างหากไว้ในฐานข้อมูลระบบ tempdb
ดังนั้นการแก้ไขข้อมูลจากตารางหลัก จะไม่มีผลกับข้อมูลที่เกิดจาก Cursor นี้ และการแก้ไขข้อมูลที่ Cursor
นี้ ไม่สามารถทำได้
> โดย KEYSET คือหมายความว่า Cursor นี้จะอาศัย Unique Indexes ในการเข้าถึงข้อมูลจริงที่เก็บไว้ในตารางหลัก
ดังนั้นหากมีการเปลี่ยนแปลงข้อมูลในตารางหลักจะทำให้ข้อมูลจาก Cursor ได้รับผลกระทบตามไปด้วย
( ถ้าหาก Table ไม่มี Unique Indexes แล้วก็จะถูกเปลี่ยนไปเป็น STATIC โดยอัตโนมัติ )
> โดย DYNAMIC เป็นการกำหนดว่าหากมีการเปลี่ยนแปลงข้อมูลที่ตารางหลักแล้ว จะมีผลต่อ Cursor ด้วย
จะทำให้ไม่สามารถใช้คำสั่ง FETCH ABSOLUTE ได้ ( วิธีการทำงานของ Cursor นี้นั้น ทุกๆครั้งที่มีการ FETCH
ข้อมูล Cursor จะถูกสร้างใหม่ ทำให้ข้อมูลมีการ UPDATE อยู่เสมอ แต่จะทำให้ใช้ Resource สูงมากตามลำดับ )
> โดย FAST_FORWARD คือจะเข้าถึง Record แรกโดยอัตโนมัติหลังจากเปิด Cursor และจะปิด Cursor
ดยอัตโนมัติทันทีเมื่อเข้าถึง Record สุดท้าย ( ไม่สามารถใช้ได้พร้อมกับคำสั่ง SCROLL, SCROLL_LOCKS,
OPTIMISTIC, FOR UPDATE ได้ )
(
เงื่อนไขของการใช้ FAST_FORWARD ดังนี้
1) เมื่อมีการ Query ระหว่าง 2 ตามรางแล้ว FAST_FORWARD จะถูกเปลี่ยนเป็น STATIC
2) เมื่อมีการ Query โดย Distributed Query แล้ว FAST_FORWARD จะถูกเปลี่ยนเป็น KEYSET
3) เมื่อมีการใช้คีย์เวิร์ด FOR UPDATE แล้ว FAST_FORWARD จะถูกเปลี่ยนแป็น DYNAMIC
4) ถ้า Query มีการอ้างถึง column ที่มีข้อมูลประเภท text, ntext หรือ image แล้ว FAST_FORWARD จะถูกเปลี่ยนเป็น DYNAMIC
5) ถ้า Query มีการอ้างถึง column ที่มีข้อมูลประเภท text, ntext หรือ image และมีคีย์เวิร์ด TOP ด้วย แล้ว FAST_FORWARD จะถูกเปลี่ยนเป็น DYNAMIC
)
> โดย READ_ONLY เป็นการกำหนดให้ Cursor อ่านได้อย่างเดียว
> โดย SCROLL_LOCKS เป็นการ Lock ข้อมูลในตารางจริง เมื่อมีการอ่านมายัง Cursor ทำให้ไม่สามารถแก้ไขข้อมูลในตารางจริงได้
> โดย OPTIMISTIC เป็นการอ่านและบันทึกลงได้ และไม่มีการ Lock ใดๆ
> โดย TYPE_WARNING กำหนดให้มีการแจ้งเตือน หากมีการเปลี่ยนแปลงประเภทของ Cursor ( ที่เปลี่ยนแปลงโดยอัตโนมัติตามเงื่อนไขต่างๆ )
> โดย FOR UPDATE เป็นการกำหนดว่า Cursor นี้สามารถ UPDATE ข้อมูลได้ และ UPDATE คอลัมน์ใดได้บ้าง
ถ้าไม่ระบุ จะหมายถึงสามารถ UPDATE ได้ทุก COLUMNexample:DECLARE @person_id int
DECLARE @person_firstname varchar(200)
DECLARE @person_lastname varchar(200)
DECLARE @person_sex int
DECLARE cur_person CURSOR FOR SELECT id, firstname, lastname, sex FROM person
OPEN cur_person
FETCH NEXT FROM cur_person INTO @person_id, @person_firstname, @person_lastname, @person_sex
PRINT 'ID : ' + @person_id
PRINT 'NAME : ' + @person_firstname + ' ' + @person_lastname
PRINT 'SEX : ' + @person_sex
CLOSE cur_person
DEALLOCATE cur_personSQL Server::Cursor::OPEN cursorsubject:OPEN cursorsyntax:OPEN { { [ GLOBAL ] cursor_name } | cursor_variable_name }content:ใช้ในการเปิด Cursorexample:DECLARE @person_id int
DECLARE @person_firstname varchar(200)
DECLARE @person_lastname varchar(200)
DECLARE @person_sex int
DECLARE cur_person CURSOR FOR SELECT id, firstname, lastname, sex FROM person
OPEN cur_person
FETCH NEXT FROM cur_person INTO @person_id, @person_firstname, @person_lastname, @person_sex
PRINT 'ID : ' + @person_id
PRINT 'NAME : ' + @person_firstname + ' ' + @person_lastname
PRINT 'SEX : ' + @person_sex
CLOSE cur_person
DEALLOCATE cur_personSQL Server::Cursor::FETCH cursorsubject:FETCH cursorsyntax:FETCH
[ [ NEXT | PRIOR | FIRST | LAST | ABSOLUTE n | RELATIVE n ] FROM ]
{ { [ GLOBAL ] cursor_name } | cursor_variable_name }
[ INTO @varname1 [, @varnameN ] ]content:ใช้ในการเข้าถึงข้อมูลของ Cursorexample:DECLARE @person_id int
DECLARE @person_firstname varchar(200)
DECLARE @person_lastname varchar(200)
DECLARE @person_sex int
DECLARE cur_person CURSOR FOR SELECT id, firstname, lastname, sex FROM person
OPEN cur_person
FETCH NEXT FROM cur_person INTO @person_id, @person_firstname, @person_lastname, @person_sex
PRINT 'ID : ' + @person_id
PRINT 'NAME : ' + @person_firstname + ' ' + @person_lastname
PRINT 'SEX : ' + @person_sex
CLOSE cur_person
DEALLOCATE cur_personSQL Server::Cursor::CLOSE cursorsubject:CLOSE cursorsyntax:CLOSE { { [ GLOBAL ] cursor_name } | cursor_variable_name }content:ใช้ในการปิด Cursor
example:DECLARE @person_id int
DECLARE @person_firstname varchar(200)
DECLARE @person_lastname varchar(200)
DECLARE @person_sex int
DECLARE cur_person CURSOR FOR SELECT id, firstname, lastname, sex FROM person
OPEN cur_person
FETCH NEXT FROM cur_person INTO @person_id, @person_firstname, @person_lastname, @person_sex
PRINT 'ID : ' + @person_id
PRINT 'NAME : ' + @person_firstname + ' ' + @person_lastname
PRINT 'SEX : ' + @person_sex
CLOSE cur_person
DEALLOCATE cur_personSQL Server::Cursor::DEALLOCATE cursorsubject:DEALLOCATE cursorsyntax:DEALLOCATE { { [ GLOBAL ] cursor_name } | cursor_variable_name }content:ใช้ในการคืนทรัพยากร ในกรณีที่ไม่ได้ใช้ Cursor นั้นแ้ล้วexample:DECLARE @person_id int
DECLARE @person_firstname varchar(200)
DECLARE @person_lastname varchar(200)
DECLARE @person_sex int
DECLARE cur_person CURSOR FOR SELECT id, firstname, lastname, sex FROM person
OPEN cur_person
FETCH NEXT FROM cur_person INTO @person_id, @person_firstname, @person_lastname, @person_sex
PRINT 'ID : ' + @person_id
PRINT 'NAME : ' + @person_firstname + ' ' + @person_lastname
PRINT 'SEX : ' + @person_sex
CLOSE cur_person
DEALLOCATE cur_personSQL Server::Cursor::@@CURSOR_ROWSsubject:@@CURSOR_ROWSsyntax:@@CURSOR_ROWS content:ถ้าคืนค่า -n เพื่อบอกว่าพบจำนวน n record และจะมากขึ้นเรื่อยๆ เพราะยังโหลดไม่เสร็จ
ถ้าคืนค่า n เพื่อบอกว่าพบจำนวน n record ( เพราะโหลดเสร็จแล้ว )
ถ้าคืนค่า -1 เพื่อบอกว่าเป็นการเปิดแบบ DYNAMIC
ถ้าคืนค่า 0 เพื่อบอกว่ามีจำนวน 0 recordexample:DECLARE @person_id int
DECLARE @person_firstname varchar(200)
DECLARE @person_lastname varchar(200)
DECLARE @person_sex int
DECLARE cur_person CURSOR FOR SELECT id, firstname, lastname, sex FROM person
OPEN cur_person
FETCH NEXT FROM cur_person INTO @person_id, @person_firstname, @person_lastname, @person_sex
WHILE @@FETCH_STATUS = 0
BEGIN
PRINT 'ID : ' + @person_id
PRINT 'NAME : ' + @person_firstname + ' ' + @person_lastname
PRINT 'SEX : ' + @person_sex
FETCH NEXT FROM cur_person INTO @person_id, @person_firstname, @person_lastname, @person_sex
END
CLOSE cur_person
DEALLOCATE cur_personSQL Server::Cursor::@@FETCH_STATUSsubject:@@FETCH_STATUSsyntax:@@FETCH_STATUScontent:ถ้าคืนค่า 0 คือเข้าถึง Record สำเร็จ
ถ้าคืนค่า -1 คือเข้าถึง Record ไม่สามารถกระทำได้ หรือได้ชี้เกิดกลุ่มของผลลัพธ์ไปแล้ว ( EOF )
ถ้าคืนค่า -2 คือการเข้าถึง Record มีความผิดพลาดเกิดขึ้นexample:DECLARE @person_id int
DECLARE @person_firstname varchar(200)
DECLARE @person_lastname varchar(200)
DECLARE @person_sex int
DECLARE cur_person CURSOR FOR SELECT id, firstname, lastname, sex FROM person
OPEN cur_person
FETCH NEXT FROM cur_person INTO @person_id, @person_firstname, @person_lastname, @person_sex
WHILE @@FETCH_STATUS = 0
BEGIN
PRINT 'ID : ' + @person_id
PRINT 'NAME : ' + @person_firstname + ' ' + @person_lastname
PRINT 'SEX : ' + @person_sex
FETCH NEXT FROM cur_person INTO @person_id, @person_firstname, @person_lastname, @person_sex
END
CLOSE cur_person
DEALLOCATE cur_personSQL Server::Cursor::ตัวอย่างการ UPDATE ข้อมูล ณ ตำแหน่งที่ Cursor ชี้อยู่subject:ตัวอย่างการ UPDATE ข้อมูล ณ ตำแหน่งที่ Cursor ชี้อยู่example:UPDATE table_name
SET column_name = value
WHERE CURRENT OF { { [ GLOBAL ] cursor_name } | cursor_variable_name }
UPDATE person
SET sex = 2
WHERE CURRENT OF cur_personSQL Server::Cursor::ตัวอย่างการ DELETE ข้อมูล ณ ตำแหน่งที่ Cursor ชี้อยู่subject:ตัวอย่างการ DELETE ข้อมูล ณ ตำแหน่งที่ Cursor ชี้อยู่example:DELETE table_name
WHERE CURRENT OF { { [ GLOBAL ] cursor_name } | cursor_variable_name }
DELETE person
WHERE CURRENT OF cur_person
วันศุกร์ที่ 8 ตุลาคม พ.ศ. 2553
Desktop background/wallpaper unlocked
Desktop background/wallpaper locked using regedit how do i unlock it?
well i have a friend who got to know a trick from his bro who the head of IT in a firm n he locked my laptop`s wallpaper
how do i unlock it ???????????
i have tried
"HKLM\SOFTWARE\Microsoft\Windows\
CurrentVersion\policies\ActiveDesktop"
&
"HKCU\Software\Microsoft\Windows\
CurrentVersion\Policies\ActiveDesktop"
In those entries look for: "NoChangingWallpaper".
If you see that make sure that the dword value is set to 0 (zero).
HKLM does not have ActiveDesktop folder in the policy folde
GO TO START
RUN
Type gpedit.msc
CLICK OK
go to user configuration (left window)
Administrative templates
Desktop
Active Desktop (single click)
on rght hand side
DOUBLE CLICK Active Desktop wallpaper
under settings
click disabled or not configured (whichever works one by one)
press ok
Restart computer,
Add: go to start , run.
Type desk.cpl
well i have a friend who got to know a trick from his bro who the head of IT in a firm n he locked my laptop`s wallpaper
how do i unlock it ???????????
i have tried
"HKLM\SOFTWARE\Microsoft\Windows\
CurrentVersion\policies\ActiveDesktop"
&
"HKCU\Software\Microsoft\Windows\
CurrentVersion\Policies\ActiveDesktop"
In those entries look for: "NoChangingWallpaper".
If you see that make sure that the dword value is set to 0 (zero).
HKLM does not have ActiveDesktop folder in the policy folde
GO TO START
RUN
Type gpedit.msc
CLICK OK
go to user configuration (left window)
Administrative templates
Desktop
Active Desktop (single click)
on rght hand side
DOUBLE CLICK Active Desktop wallpaper
under settings
click disabled or not configured (whichever works one by one)
press ok
Restart computer,
Add: go to start , run.
Type desk.cpl
วันพุธที่ 29 กันยายน พ.ศ. 2553
แก้ไขให้ Mouse wheel ใช้งานได้ใน Visual Basic 6.0
Method 1
loadTOCNode(3, 'workaround');Download the VB6 Mouse Wheel.exe file that includes the add-in DLL and the code that is used to create the add-in DLL.1. Download the VB6 Mouse Wheel.exe file. The following file is available for download from the Microsoft Download Center:
Download the VB6MouseWheel.EXE package now. (http://download.microsoft.com/download/e/f/b/efb39198-7c59-4ace-a5c4-8f0f88e00d34/vb6mousewheel.exe)
For more information about how to download Microsoft support files, click the following article number to view the article in the Microsoft Knowledge Base:
119591 (http://support.microsoft.com/kb/119591/) How to obtain Microsoft support files from online services
Microsoft scanned this file for viruses. Microsoft used the most current virus-detection software that was available on the date that the file was posted. The file is stored on security-enhanced servers that help prevent any unauthorized changes to the file.
2. Click Start, click Run, type regsvr32\VB6IDEMouseWheelAddin.dll, and then click OK.
3. Start Visual Basic 6.0.
4. Click Add-Ins, and then click Add-in Manager.
5. In the Add-in Manager list, click MouseWheel Fix.
6. Click to select the Loaded/Unloaded check box, and then click to select the Load on Startup check box.
7. Click OK.
loadTOCNode(3, 'workaround');Download the VB6 Mouse Wheel.exe file that includes the add-in DLL and the code that is used to create the add-in DLL.1. Download the VB6 Mouse Wheel.exe file. The following file is available for download from the Microsoft Download Center:
Download the VB6MouseWheel.EXE package now. (http://download.microsoft.com/download/e/f/b/efb39198-7c59-4ace-a5c4-8f0f88e00d34/vb6mousewheel.exe)
For more information about how to download Microsoft support files, click the following article number to view the article in the Microsoft Knowledge Base:
119591 (http://support.microsoft.com/kb/119591/) How to obtain Microsoft support files from online services
Microsoft scanned this file for viruses. Microsoft used the most current virus-detection software that was available on the date that the file was posted. The file is stored on security-enhanced servers that help prevent any unauthorized changes to the file.
2. Click Start, click Run, type regsvr32
3. Start Visual Basic 6.0.
4. Click Add-Ins, and then click Add-in Manager.
5. In the Add-in Manager list, click MouseWheel Fix.
6. Click to select the Loaded/Unloaded check box, and then click to select the Load on Startup check box.
7. Click OK.
สมัครสมาชิก:
บทความ (Atom)