Assalamualaikum

Assalamualaikum...
Salam sejahtera untuk semua sahabat yang sudah setia pada blog ini
salam sejahtera juga untuk semua teman-teman di STMIK Bina Bangsa Lhokseumawe

The syntax for creating a table


The syntax for creating a table is as follows:
CREATE TABLE  (
       field1 datatype,
       field2 datatype,
       etc......
);
When splitting over multiple lines within the MySQL command line the continuation indictor(->) will be used.
mysql>
mysql> CREATE TABLE employee (
    ->     ID INT(2) auto_increment primary key,
    ->     First_name VARCHAR(20),
    ->     Last_name VARCHAR(30),
    ->     Start_date DATE,
    ->     Salary int(6),
    ->     city VARCHAR(20),
    ->     description VARCHAR(20)
    -> );
Query OK, rows affected (0.03 sec)

mysql>
mysql> desc employee;
+-------------+-------------+------+-----+---------+----------------+
| Field       | Type        | Null | Key | Default | Extra          |
+-------------+-------------+------+-----+---------+----------------+
| ID          | int(2)      | NO   | PRI | NULL    | auto_increment |
| First_name  | varchar(20) | YES  |     | NULL    |                |
| Last_name   | varchar(30) | YES  |     | NULL    |                |
| Start_date  | date        | YES  |     | NULL    |                |
| Salary      | int(6)      | YES  |     | NULL    |                |
| city        | varchar(20) | YES  |     | NULL    |                |
| description | varchar(20) | YES  |     | NULL    |                |
+-------------+-------------+------+-----+---------+----------------+
rows in set (0.05 sec)

mysql>
mysql> drop table employee;
Query OK, rows affected (0.00 sec)

mysql>

Making new control with in visual basic 6.0

Open new project and prepare one command button . last type code of following at form.
Public Function LoadControl(oForm As Object, _
CtlType As String, CtlName As String, nTop As Double, nLeft As Double) As Object
Dim oCtl As Object
On Error Resume Next
If IsObject(oForm.Controls) Then
Set oCtl = oForm.Controls.Add(CtlType, CtlName)
If Not oCtl Is Nothing Then Set LoadControl = oCtl
oCtl.Top = nTop
oCtl.Left = nLeft
oCtl.Visible = True
oCtl.Caption = "Label1"
End If
End Function

Private Sub Command1_Click()
LoadControl Form1, "vb.textbox", "text1", 100, 1000
LoadControl Form1, "VB.CommandButton", "Tombol", 1000, 1000
LoadControl Form1, "vb.Combobox", "cmb1", 2200, 1000
End Sub
Press F5 to running program

Make Form Transparan With VB 6.0


To make visual transparent Form in Visual basic 6.0 opening new project and enhance a modul.modul can be enhanced by click of project add module . typing code  following into module.
Private Declare Function SetLayeredWindowAttributes Lib "user32" _
(ByVal hwnd As Long, ByVal crKey As Long, ByVal bAlpha As Byte, _
ByVal dwFlags As Long) As Long

Private Declare Function UpdateLayeredWindow Lib "user32" _
(ByVal hwnd As Long, ByVal hDCDst As Long, pptDst As Any, _
psize As Any, ByVal hDCSrc As Long, pptSrc As Any, crKey As Long, _
ByVal pblend As Long, ByVal dwFlags As Long) As Long

Private Declare Function GetWindowLong Lib "user32" Alias _
"GetWindowLongA" (ByVal hwnd As Long, ByVal nIndex As Long) As Long

Private Declare Function SetWindowLong Lib "user32" Alias _
"SetWindowLongA" (ByVal hwnd As Long, ByVal nIndex As Long, _
ByVal dwNewLong As Long) As Long

Private Const GWL_EXSTYLE = (-20)
Private Const LWA_COLORKEY = &H1
Private Const LWA_ALPHA = &H2
Private Const ULW_COLORKEY = &H1
Private Const ULW_ALPHA = &H2
Private Const ULW_OPAQUE = &H4
Private Const WS_EX_LAYERED = &H80000

Public Function MakeTransparent(ByVal hwnd As Long, Perc As Integer) As Long
Dim Msg As Long
On Error Resume Next
If Perc < 0 Or Perc > 255 Then
MakeTransparent = 1
Else
Msg = GetWindowLong(hwnd, GWL_EXSTYLE)
Msg = Msg Or WS_EX_LAYERED
SetWindowLong hwnd, GWL_EXSTYLE, Msg
SetLayeredWindowAttributes hwnd, 0, Perc, LWA_ALPHA
MakeTransparent = 0
End If
If Err Then
MakeTransparent = 2
End If
End Function

''==========
After code in module have been typed later;then type code of following at form in Event load.
Private sub Form_load()
MakeTransparent Me.hwnd, 150
‘150 è can be altered - alter.
End sub
Running form by pressing F5
Result it like picture following.Ubah form transparan
 

Popular Posts