Monday, September 29, 2008

Run SQL Server 2000 DTS by Stored Procedure

1. “Windows” + “R” พิมพ์ dtsrunui ในช่อง Open แล้วกด OK



2. จะมีหน้าจอตามรูปด้านล่าง ใส่ ip server ในช่อง Server แล้วก็ใส่ Username และ Password ของ Server นั้น หลังจากนั้นกดปุ่ม ... หลังช่อง Package name จะมี list ของ DTS ใน Server นั้นมาให้เราเลือก เลือก DTS ที่ต้องการ แล้วกด OK



3. จากรูปในขั้นตอนที่แล้ว กดปุ่ม Advanced... จะได้หน้าจอตามรูปด้านล่าง กดปุ่ม Generate... จะมี command ขึ้นมาในช่องด้านหน้า ถ้าต้องการ Encrypt command เพื่อไม่ให้เห็น username และ password ให้ติ๊กถูกที่ Encrypt the command แล้วกด Generate อีกรอบ จะได้ command ที่ encrypt ไว้



4. หลังจากนั้นเอา command ที่ได้ มารันเหมือน SQL ปกติตาม code ด้านล่างนี้

EXEC master..xp_cmdshell {'command_string'}

http://msdn.microsoft.com/en-us/library/aa260689(SQL.80).aspx

Friday, September 19, 2008

Change datetime format and language on oracle

SELECT USERENV('language') from dual;

SELECT to_char(sysdate,'dd-mon-yyyy') FROM dual;

ALTER SESSION SET nls_language = 'AMERICAN';

SELECT to_char(sysdate,'dd-mon-yyyy') FROM dual;

ALTER SESSION SET nls_language = 'THAI';

SELECT to_char(sysdate,'dd-mon-yyyy') FROM dual;

http://www.dba-oracle.com/t_nls_date_format_sysdate.htm
http://infolab.stanford.edu/~ullman/fcdb/oracle/or-time.html

Thursday, September 18, 2008

How to disable right click (Context Menu) on object in browser

Example in picture object:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title> new document </title>
<script language="javascript">
function disableContextMenu(obj) {
obj.oncontextmenu = function() {
return false;
}
}
function onLoad() {
disableContextMenu(document.getElementById("Pic1"));
}
</script>
</head>
<body onload="onLoad()">
<img id="Pic1" src="Pic1.jpg" alt="Picture" />
</body>
</html>

Or use this code:
<img id="Pic1" src="Pic1.jpg" alt="Picture" onmouseover="this.oncontextmenu=function(){return false}" />

Result:


XHTML table or div height in percentage (%)

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" >
<head>
<title>Height 100%</title>
<style type="text/css">
html {
height:100%;
}
body {
height:100%;
margin:0;
padding:0;
}
</style>
</head>
<body>
<table style="height:100%; width:100%" border="1">
<tr><td>Top</td></tr>
<tr><td>Middle</td></tr>
<tr>
<td valign="bottom">
<table style="height:80px; width:100%" border="1">
<tr><td>bottom</td></tr>
</table>
</td>
</tr>
</table>
</body>
</html>

http://apptools.com/examples/tableheight.php
http://www.webmasterworld.com/forum83/200.htm

How to enable disable Ctrl + Alt + Del before logon XP or Vista

1. Windows + r and type control userpasswords2 (XP, Vista) or netplwiz (Vista only).




2. Goto advance tab on popup window. You can check the checkbox for enable ctrl + alt + del and uncheck the checkbox for disable ctrl + alt + del before logon.

Tuesday, September 16, 2008

Auto delete text on textbox on focus and restore text on unfocus

Code:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">

<head>
<title> new document </title>
<meta name="generator" content="" />
<meta name="author" content="" />
<meta name="keywords" content="" />
<meta name="description" content="" />
</head>

<body>
<input type="text" id="email" value="Your e-mail here" onfocus="if(this.value=='Your e-mail here')this.value=''"
onblur="if(this.value=='')this.value='Your e-mail here'" />
</body>

</html>

Result:

Auto select all text on textbox

Code:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">

<head>
<title> new document </title>
<meta name="generator" content="" />
<meta name="author" content="" />
<meta name="keywords" content="" />
<meta name="description" content="" />
</head>

<body>
<input type="text" id="email" value="Your E-mail here" onfocus="this.select()" />
</body>

</html>

Result:

Command prompts for Windows

http://en.kioskea.net/faq/sujet-403-command-prompts-for-windows

Monday, September 8, 2008

Crystal reports component for server

If you want to run ASP.NET website include crystal reports on web server. The web server will can't run its because server not install crystal report component.

The crystal reports component can found on developer's computer path below

Path:
C:\Program Files\Microsoft Visual Studio 8\SDK\v2.0\BootStrapper\Packages\CrystalReports\


Copy all to install on your server and run your website again.