Tuesday, March 23, 2010

VB6 Code - Fungsi CSS Compress Opsi Super Compact

Mengenai fungsi VB6 untuk mengcompress CSS super compact - Artikel di bawah ini kami beri judul fungsi css compress opsi super compact. Apa yang dimaksud dengan css compress ini, bisa Anda lihat pada link disamping ini [css compress]. Nah, sekarang Anda faham mengenai apa tujuan, kegunaan dan mengapa kode css dikompres. Bagaimana implementasi kode css compress ini pada pemrograman Visual Basic 6.0? bisa Anda lihat kodenya di bawah.

Kode fungsi css compress opsi super compact
Option Explicit

Function CSSCompressSuperCompact(sText As String) As String
Dim sTextCSS As String
Dim arrCSS() As String
Dim i As Integer
sTextCSS = sText
sTextCSS = Replace(sTextCSS, " ", "")
sTextCSS = Replace(sTextCSS, vbCrLf, "")
arrCSS = Split(sTextCSS, vbCrLf)
sTextCSS = ""
For i = LBound(arrCSS) To UBound(arrCSS)
If arrCSS(i) <> "" Then
sTextCSS = sTextCSS & arrCSS(i) & vbCrLf
End If
Next
CSSCompressSuperCompact = sTextCSS
End Function
Contoh penggunaan css compress opsi super compact
Private Sub Command1_Click()
Text1.Text = CSSCompressSuperCompact(Text1.Text)
End Sub
READ MORE - VB6 Code - Fungsi CSS Compress Opsi Super Compact

VB6 Code - Fungsi CSS Compress Opsi Normal

Mengenai fungsi VB6 untuk mengcompress CSS secara normal - Artikel di bawah ini kami beri judul fungsi css compress opsi normal. Apa yang dimaksud dengan css compress ini, bisa Anda lihat pada link disamping ini [css compress]. Nah, sekarang Anda faham mengenai apa tujuan, kegunaan dan mengapa kode css dikompres. Bagaimana implementasi kode css compress ini pada pemrograman Visual Basic 6.0? bisa Anda lihat kodenya di bawah.

Kode fungsi css compress opsi normal
Option Explicit

Function CSSCompressNormal(sText As String) As String
Dim sTextCSS As String
Dim arrCSS() As String
Dim i As Integer
sTextCSS = sText
sTextCSS = Replace(sTextCSS, " ", "")
sTextCSS = Replace(sTextCSS, vbCrLf, "")
sTextCSS = Replace(sTextCSS, "}", "}" & vbCrLf)
sTextCSS = Replace(sTextCSS, "*/", "*/" & vbCrLf)
arrCSS = Split(sTextCSS, vbCrLf)
sTextCSS = ""
For i = LBound(arrCSS) To UBound(arrCSS)
If arrCSS(i) <> "" Then
sTextCSS = sTextCSS & arrCSS(i) & vbCrLf
End If
Next
CSSCompressNormal = sTextCSS
End Function
Contoh penggunaan css compress opsi normal
Private Sub Command1_Click()
Text1.Text = CSSCompressNormal(Text1.Text)
End Sub

Posted by Mesin Posting 1.0 Created by http://khoiriyyah.blogspot.com
READ MORE - VB6 Code - Fungsi CSS Compress Opsi Normal

VB6 Code Fungsi CSS Compress Opsi Light

Mengenai Fungsi CSS Compress Opsi Light menggunakan VB6 - Artikel di bawah ini kami beri judul fungsi css compress opsi light. Apa yang dimaksud dengan css compress ini, bisa Anda lihat pada link disamping ini [css compress]. Nah, sekarang Anda faham mengenai apa tujuan, kegunaan dan mengapa kode css dikompres. Bagaimana implementasi kode css ini pada pemrograman Visual Basic 6.0? bisa Anda lihat kodenya di bawah.

Kode fungsi css compress opsi light
Option Explicit

Public Function CSSCompressLight(sText As String) As String
Dim sTextCSS As String
Dim arrCSS() As String
sTextCSS = sText
sTextCSS = Replace(sTextCSS, " ", "")
arrCSS = Split(sTextCSS, vbCrLf)
sTextCSS = ""
For i = LBound(arrCSS) To UBound(arrCSS)
If arrCSS(i) <> "" Then
sTextCSS = sTextCSS & arrCSS(i) & vbCrLf
End If
Next
CSSCompressLight = sTextCSS
End Function
Cara penggunaan fungsi css compress opsi light
Private Sub  Command1_Click()
Text1.Text = CSSCompress(Text1.Text)
End Sub
Posted by Mesin Posting 1.0 Created by http://khoiriyyah.blogspot.com
READ MORE - VB6 Code Fungsi CSS Compress Opsi Light

Monday, March 22, 2010

Data Link Properties Dialog Box Cara Menampilkannya

'simpan kode di bawah pada modul Option Explicit 

Public Function
getADOConnectionString(Optional ByVal cnStringToEdit As String = "", Optional sPrePromptUserMessage As String = "") As String

Dim
sActivity As String
Dim
dl As Object
Dim
cn As Object

On Error GoTo
ErrGetAdoConnectionString
sActivity = "Creating Datalinks object."

Set
dl = CreateObject("DataLinks")

If Not
"" = cnStringToEdit) Then

If Not
"" = sPrePromptUserMessage) Then
MsgBox sPrePromptUserMessage, vbInformation, "Connecting to Database..."
End If
sActivity = "Creating ADODB.Connection object"
Set cn = CreateObject("ADODB.Connection")

cn.ConnectionString = "Provider=SQLOLEDB.1;Initial Catalog=PUBS"

sActivity = "Prompting user to edit connect string"
dl.PromptEdit cn

Else
sActivity = "Prompting user for new connect string"
Set cn = dl.PromptNew()

End If

If
cn Is Nothing Then
getADOConnectionString = ""
Exit Function
End If

getADOConnectionString = cn.ConnectionString

Set
cn = Nothing

Exit Function

ErrGetAdoConnectionString:

Dim
sMsg As String

Set
cn = Nothing

sMsg = "Error While [" + sActivity + "]. Details are below: " + vbCrLf
sMsg = sMsg + "Description:[" + Err.Description + "]." + vbCrLf
sMsg = sMsg + "Source:[" & Err.Source & "]." + vbCrLf
sMsg = sMsg + "Number:[" & Err.Number & "]." + vbCrLf
sMsg = sMsg + "Help File:[" & Err.HelpFile & "]." + vbCrLf
MsgBox sMsg, vbCritical, "Error Connecting to Database."

End Function
Contoh penggunaan fungsi di atas:
'simpan kode di bawah pada form Option Explicit 

Private Sub
Command1_Click()

On Error GoTo
ErrHandler

Dim
strCon As String
strCon = getADOConnectionString()
If strCon = "" Then Exit Sub
'kode selanjutnya disini
Exit Sub

ErrHandler:

MsgBox Err.Number & vbNewLine & Err.Description, vbExclamation + vbOKOnly, "Connection Error"

End Sub
READ MORE - Data Link Properties Dialog Box Cara Menampilkannya