Monday, August 27, 2007

JAVA > Script > swap value between list


onClick='fncManageList(document.all.testlist, document.all.packagelist)'

function fncManageList(obj1, obj2){
for (var i=0; i if (obj1.options[i].selected == true){
var text = obj1.options[i].text;
var value = obj1.options[i].value;
obj2.options[obj2.options.length] = new Option(text, value);
}
}
for (var i=obj1.length-1; i>=0; i--){
if (obj1.options[i].selected == true){
obj1.remove(i);
}
}

fncSumTestPrice();
}

JAVA > Script > LiveAudio


<HTML>
<HEAD>
<SCRIPT LANGUAGE=JavaScript>

function playSound() {
document.firstSound.play(false);
}

function pauseSound() {
document.firstSound.pause();
}

function stopSound() {
document.firstSound.stop();
}

function volup() {
currentVolume = document.firstSound.GetVolume();
newVolume = ( currentVolume + 10 ) ;
if ( document.firstSound.GetVolume() == 100 ) {
alert("Volume is already at maximum");
}
if ( newVolume < 90 ) {
document.firstSound.setvol(newVolume) ;
} else {
if ( ( newVolume <= 100 ) && ( newVolume > 90 ) ) {
document.firstSound.setvol(100) ;
}
}
}

function voldown() {
currentVolume = document.firstSound.GetVolume();
newVolume = ( currentVolume - 10 ) ;
if ( document.firstSound.GetVolume() == 0 ) {
alert("Volume is already at minimum");
}
if ( newVolume > 10 ) {
document.firstSound.setvol(newVolume) ;
} else {
if ( ( newVolume >= 0 ) && ( newVolume < 10 ) ) {
document.firstSound.setvol(0) ;
}
}
}

</SCRIPT>
</HEAD>
<BODY>
<EMBED SRC="sound1.wav" HIDDEN=TRUE AUTOSTART=FALSE NAME="firstSound" MASTERSOUND>
<P><A HREF="javascript:playSound()">Play the sound now!</A></P>
<P><A HREF="javascript:pauseSound()">Pause the sound now!</A></P>
<P><A HREF="javascript:stopSound()">Stop the sound now!</A></P>
<P><A HREF="javascript:volup()">Increment the Volume!</A></P>
<P><A HREF="javascript:voldown()">Decrement the Volume!</A></P>
</BODY>
</HTML>

DB > Connection > MySQL connection strings

MySQL ODBC connection strings

Open connection to local MySQL database using MySQL ODBC 3.51 Driver
"Provider=MSDASQL; DRIVER={MySQL ODBC 3.51Driver}; SERVER= localhost; DATABASE=Your_MySQL_Database; UID= Your_Username; PASSWORD=Your_Password;

OPTION=3"


MySQL OLE DB & OleDbConnection (.NET framework) connection strings

Open connection to MySQL database:
"Provider=MySQLProv;Data Source=Your_MySQL_Database;User Id=Your_Username; Password=Your_Password;"

DB > Connection > Oracle connection strings

Oracle ODBC connection strings
Open connection to Oracle database using ODBC
"Driver= {Microsoft ODBCforOracle};Server=Your_Oracle_Server.world;Uid=Your_Username;Pwd=Your_Password;"


Oracle OLE DB & OleDbConnection (.NET framework) connection strings

Open connection to Oracle database with standard security:
1. "Provider=MSDAORA;Data Source= Your_Oracle_Database;UserId=Your_Username;Password=Your_Password;"
2. "Provider= OraOLEDB.Oracle;Your_Oracle_Database;UserId=Your_Username;Password=Your_Password;"

Open trusted connection to Oracle database
"Provider= OraOLEDB.Oracle;DataSource=Your_Oracle_Database;OSAuthent=1;"

Password=Your_Password;"

DB > Connection > MS Access connection strings

MS Access ODBC connection strings

Standard Security:
"Driver= {MicrosoftAccessDriver(*.mdb)};DBQ=C:\App1\Your_Database_Name.mdb;Uid=Your_Username;Pwd=Your_Password;"

Workgroup:
"Driver={Microsoft Access Driver (*.mdb)}; Dbq=C:\App1\Your_Database_Name.mdb; SystemDB=C:\App1\Your_Database_Name.mdw;"

Exclusive "Driver={Microsoft Access Driver (*.mdb)}; DBQ=C:\App1\Your_Database_Name.mdb; Exclusive=1; Uid=Your_Username; Pwd=Your_Password;"


MS Access OLE DB & OleDbConnection (.NET framework) connection strings

Open connection to Access database:
"Provider=Microsoft.Jet.OLEDB.4.0; Data Source=c:\App1\Your_Database_Name.mdb; User Id=admin; Password="

Open connection to Access database using Workgroup (System database):
"Provider=Microsoft.Jet.OLEDB.4.0; Data Source=c:\App1\Your_Database_Name.mdb; Jet OLEDB:System Database=c:\App1\Your_System_Database_Name.mdw"

Open connection to password protected Access database:
"Provider=Microsoft.Jet.OLEDB.4.0; Data Source=c:\App1\Your_Database_Name.mdb; Jet OLEDB:Database Password=Your_Password"

Open connection to Access database located on a network share:
"Provider=Microsoft.Jet.OLEDB.4.0; Data Source=\\Server_Name\Share_Name\Share_Path\Your_Database_Name.mdb"

Open connection to Access database located on a remote server:
"Provider=MS Remote; Remote Server=http://Your-Remote-Server-IP; Remote Provider=Microsoft.Jet.OLEDB.4.0; Data Source=c:\App1\Your_Database_Name.mdb"

DB > Connection > SQL Server connection strings

SQL ODBC connection strings
Standard Security:<> "Driver={SQLServer};Server=Your_Server_Name;Database=Your_Database_Name;Uid=Your_Username;Pwd=Your_Password;"

Trusted connection:<> "Driver={SQLServer};Server=Your_Server_Name;Database=Your_Database_Name;Trusted_Connection=yes;"

SQL OLE DB connection strings
Standard Security:
"Provider=SQLOLEDB;Data Source=Your_Server_Name;Initial Catalog= Your_Database_Name;UserId=Your_Username;Password=Your_Password;"

Trusted connection:
"Provider=SQLOLEDB;Data Source=Your_Server_Name;Initial Catalog=Your_Database_Name;Integrated Security=SSPI;"

SQL OleDbConnection .NET strings
Standard Security:
"Provider=SQLOLEDB;Data Source=Your_Server_Name;Initial Catalog= Your_Database_Name;UserId=Your_Username;Password=Your_Password;"

Trusted connection:
"Provider=SQLOLEDB;Data Source=Your_Server_Name;Initial Catalog=Your_Database_Name;Integrated Security=SSPI;"

SQL SqlConnection .NET strings
Standard Security:
1. "Data Source=Your_Server_Name;Initial Catalog= Your_Database_Name;UserId=Your_Username;Password=Your_Password;" <>2.

"Server=Your_Server_Name;Database=Your_Database_Name;UserID=Your_Username;Password=Your_Password;Trusted_Connection=False"

Trusted connection:
1. "Data Source=Your_Server_Name;Initial Catalog=Your_Database_Name;Integrated Security=SSPI;"
2."Server=Your_Server_Name;Database=Your_Database_Name;Trusted_Connection=True;"