วันพุธที่ 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.

วันพฤหัสบดีที่ 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

วันอังคารที่ 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

วันศุกร์ที่ 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