Cek eksistensi file di vb6

Dim CekFolderFile As String
CekFolderFile = App.path

If Right$(CekFolderFile, 1) <> “\” Then CekFolderFile = CekFolderFile & “\Database\”
CekFolderFile = CekFolderFile & “DB_Login.mdb”

If Not FileExist(CekFolderFile) Then
MsgBox “Maaf, file Database Login tidak ada … gagal loading, hubungi Administrator ! “, vbCritical, _
“Terjadi Kesalahan : Aplikasi tidak bisa dilanjutkan ”
End
Else

End If

Iklan
Categories: Tak Berkategori, VB6 | Tinggalkan komentar

Catat nama komputer di VB6

Private Declare Function GetComputerName Lib “kernel32” Alias “GetComputerNameA” (ByVal lpBuffer As String, nSize As Long) As Long
Public Function GetWinComputerName() As String
Dim sBuffer As String
Dim lBufSize As Long
Dim lStatus As Long
lBufSize = 255
sBuffer = String$(lBufSize, ” “)
lStatus = GetComputerName(sBuffer, lBufSize)
GetWinComputerName = “”
If lStatus <> 0 Then
GetWinComputerName = Left(sBuffer, lBufSize)
End If

End Function

————–
Di coding form :
Label1.Caption = “Nama Komputer ini : ” & GetWinComputerName

Categories: Tak Berkategori, VB6 | Tinggalkan komentar

Contoh Pembuatan file log

<%
Dim fso, MyFile
Set fso = CreateObject(“Scripting.FileSystemObject”)

Dim CekIp
CekIP = Request.ServerVariables(“REMOTE_ADDR”)

If (fso.FileExists(Server.MapPath(“LogHapus.log”))) Then
Const ForReading = 1, ForWriting = 2, ForAppending = 8
Filenyo = Server.MapPath(“LogHapus.log”)

Set f = fso.OpenTextFile(Filenyo, ForAppending, True)
f.WriteLine
f.WriteLine
f.WriteLine(“=================================================”)
f.Write(“Waktu Penghapusan : “)
f.WriteLine (FormatTanggal(now()) + ” ” + Bla + ” Wib”)
f.WriteLine(“————————————————-“)
f.Write(“Penghapusan dari Ip address : “)
f.WriteLine(CekIP)
f.Write(“Yang Melakukan Penghapusan : “)
f.WriteLine(Request.Cookies(“Operator_Sales”))

f.WriteLine(“=================================================”)

f.Close

Else

Set MyFile = fso.CreateTextFile(Server.MapPath(“LogHapus.log”))
MyFile.WriteLine
MyFile.WriteLine(“-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-“)
MyFile.WriteLine(“Contoh buat Log”)
MyFile.WriteLine(“Copyright©2003, Armansyah”)
MyFile.WriteLine(“-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-“)
MyFile.WriteLine
MyFile.WriteLine(“~~~~~~~~~~~~~~~~~~~”)
MyFile.Write(“Waktu Penghapusan Awal : “)
MyFile.WriteLine (FormatTanggal(now()) + ” ” + Bla + ” Wib”)
MyFile.Write(“Penghapusan dari Ip address : “)
MyFile.WriteLine(CekIP)
MyFile.Write(“Yang Melakukan Penghapusan : “)
MyFile.WriteLine(Request.Cookies(“Operator_Sales”))

MyFile.WriteLine(“~~~~~~~~~~~~~~~~~~~”)
MyFile.Close

End If

%>

Categories: Classic ASP | Tinggalkan komentar

Contoh integrasi ASP dan VB6

<%
‘Contoh integrasi ActiveX-VB6 dengan Classic ASP

Dim komponenvbku
set komponenvbku = Server.CreateObject(“roundmin2.VB6forASP”)

‘Pastikan komponen roundmin2.dll sudah diregister kesystem
’roundmin2.dll adalah component fungsi round -2 yg dibuat dengan VB6 untuk ASP

if MBruto <>
MPPH = 0
else

if MBruto <= MSubsII Then
MPPH = komponenvbku.FungsiRound(MPPH-MPPHSub*1, -2)

else
MPPH = komponenvbku.FungsiRound(MPPH*1, -2)

end if
end if

%>

Categories: Classic ASP, VB6 | Tinggalkan komentar

Script lacak IP di Klasik ASP

<%
Dim LacakIP
LacakIP = Request.ServerVariables(“REMOTE_ADDR”)

%>

Categories: Classic ASP | Tinggalkan komentar

Script lacak IP di Klasik ASP

<%
Dim LacakIP
LacakIP = Request.ServerVariables(“REMOTE_ADDR”)

%>

Categories: Classic ASP | Tinggalkan komentar

Contoh Skrip Log Off

<%
‘Contoh proses logoff dan simpan kedatabase di klasik asp

Dim adoLog
Dim rsLog
Dim ConLog
Dim LacakKukis
LacakKukis = Request.Cookies(“kapanmasoknyo”)

Set adoLog = Server.CreateObject(“ADODB.Connection”)
adoLog.Open “DRIVER={Microsoft Access Driver (*.mdb)};uid=;pwd=manomatokau;DBQ=” & Server.MapPath(“../…/Database/mdb/masuklahoiy.mdb”)
Set rsLog = Server.CreateObject(“ADODB.Recordset”)

Dim SqlLog
SqlLog = “Select * from logoff Where waktuloginid Like ‘%” & LacakKukis & “%’ ”

rsLog.CursorType = 2
rsLog.LockType = 3
rsLog.Open SqlLog, adoLog

Dim Bla2
Dim DatNow2
DatNow2 = now()
Bla2 = Server.HTMLEncode(FormatDateTime(datNow2,3))

Dim TanggalSekarangId
TanggalSekarangId = Server.HTMLEncode(FormatTanggal(now()))

Dim TanggalIndonesia
TanggalIndonesia = TanggalSekarangId + ” ” + Bla2

rsLog.Fields(“waktulogoffid”) = TanggalIndonesia
rsLog.Fields(“waktulogoff”) = now()

rsLog.Update
rsLog.Close
Set rsLog = Nothing
Set adoLog = Nothing

‘——– akhir proses penyimpanan data login

If Session(“iyodakye”) = True then
Session.Contents.Remove(“iyodakye”)

Else

If Session(“iyodakye”) = False or IsNull(Session(“iyodakye”)) = True then

End If
End If
%>

Categories: Classic ASP | Tinggalkan komentar

Contoh Skrip Log Off

<%
‘Contoh proses logoff dan simpan kedatabase di klasik asp

Dim adoLog
Dim rsLog
Dim ConLog
Dim LacakKukis
LacakKukis = Request.Cookies(“kapanmasoknyo”)

Set adoLog = Server.CreateObject(“ADODB.Connection”)
adoLog.Open “DRIVER={Microsoft Access Driver (*.mdb)};uid=;pwd=manomatokau;DBQ=” & Server.MapPath(“../…/Database/mdb/masuklahoiy.mdb”)
Set rsLog = Server.CreateObject(“ADODB.Recordset”)

Dim SqlLog
SqlLog = “Select * from logoff Where waktuloginid Like ‘%” & LacakKukis & “%’ ”

rsLog.CursorType = 2
rsLog.LockType = 3
rsLog.Open SqlLog, adoLog

Dim Bla2
Dim DatNow2
DatNow2 = now()
Bla2 = Server.HTMLEncode(FormatDateTime(datNow2,3))

Dim TanggalSekarangId
TanggalSekarangId = Server.HTMLEncode(FormatTanggal(now()))

Dim TanggalIndonesia
TanggalIndonesia = TanggalSekarangId + ” ” + Bla2

rsLog.Fields(“waktulogoffid”) = TanggalIndonesia
rsLog.Fields(“waktulogoff”) = now()

rsLog.Update
rsLog.Close
Set rsLog = Nothing
Set adoLog = Nothing

‘——– akhir proses penyimpanan data login

If Session(“iyodakye”) = True then
Session.Contents.Remove(“iyodakye”)

Else

If Session(“iyodakye”) = False or IsNull(Session(“iyodakye”)) = True then

End If
End If
%>

Categories: Classic ASP | Tinggalkan komentar

Cek Konsistensi File

************************************
* Sub program melihat isi file
*************************************
Proc Struk
Private isi, buka, semu, kapasitas, periksa, war_vir, lay_vir
War_Vir= SETCOLOR()
SAVE SCREEN TO LAY_VIR

/* Membuka file Command.Com */
BUKA= FOPEN(“C:\COMMAND.COM”)
/* File Command.Com ini hanya kepunyaan Arman MS-DOS 6.22 dgn kapasitas
sebesar 54,645 Bytes */

/* Membaca pada baris ke-512 */
ISI= FREADSTR(BUKA, 512)
/* Tanya Ascii-nya berapa */
PERIKSA= ASC(RIGHT(ISI, 1))

KAPASITAS= FSEEK(BUKA, 0, 2)
/* 54645 adalah besar kapasitas file COMMAND.COM */
SEMU= TRANSFORM(KAPASITAS – 54645, “999,999 Byte”)
FCLOSE(BUKA)
/* Kode Ascii-nya adl. 21 dibandingkan juga dgn kapasitas */
IF PERIKSA <> 21 .OR. KAPASITAS <> 54645
POPERROR(“COMMAND.COM Berubah, ” + ;
“File ini mungkin telah terjangkit Virus !!! ” + ;
“Kapasitas Semu : ” + SEMU)
ENDIF
SETCOLOR(WAR_VIR)
RESTORE SCREEN FROM LAY_VIR
RETURN

Categories: Clipper | Tinggalkan komentar

Membuat Database di Clipper

* -=-=-=-=–=-=-=-=-=-=-=-=-=-=
* Membuat DataBase Registrasi
* -=-=-=-=-=–=-=-=-=-=-=-=-=-=
Save Screen To Independence
If ! File(‘MHSISWA.DBF’)
set color to gr+/b
sisa=diskspace()
pesan=”Sedang membuat DataBase…”
persen=”[ % ]”
sorot=”[ “+repl(chr(176),60)+” ]”
sisa=” Sisa Memori Komputer : ” + TRANSFORM((MEMORY(0)*1024), “@E 999,999,999. Byte”)

box3d(05,05,13,75,1)
shadow(05,05,13,75)

@ 07,40-len(pesan)/2 Say pesan
@ 08,40-len(persen)/2 Say persen
@ 09,40-len(sorot)/2 Say sorot
@ 11,40-len(sisa)/2 Say sisa
x=1
do while x<61
@ 08,37 Say x+40 pict “999”

Set Colo to rb/w
@ 09,10 Say repl(chr(219),x)

set color to gr+/w
x=x+1
waktu=1
do while waktu<1000
waktu=waktu+1
enddo
enddo
tone(100,2)
tone(300,4)

DECLARE FN[17],FT[17],FL[17],FD[17]

FN[1]=’Nomor’
FT[1]=’C’
FL[1]=6
FD[1]=0

FN[2]=’Nama_Siswa’
FT[2]=’C’
FL[2]=20
FD[2]=0

FN[3]=’Alamat’
FT[3]=’C’
FL[3]=40
FD[3]=0

FN[4]=’Jenis’
FT[4]=’C’
FL[4]=1
FD[4]=0

FN[5]=’Info’
FT[5]=’C’
FL[5]=12
FD[5]=0

FN[6]=’Temp_Lahir’
FT[6]=’C’
FL[6]=15
FD[6]=0

FN[7]=’Tgl_Lahir’
FT[7]=’D’
FL[7]=8
FD[7]=0

FN[8]=’Agama’
FT[8]=’C’
FL[8]=1
FD[8]=0

FN[9]=’Info1′
FT[9]=’C’
FL[9]=10
FD[9]=0

FN[10]=’Fakultas’
FT[10]=’C’
FL[10]=1
FD[10]=0

FN[11]=’Info2′
FT[11]=’C’
FL[11]=20
FD[11]=0

FN[12]=’Jurusan’
FT[12]=’C’
FL[12]=1
FD[12]=0

FN[13]=’Info3′
FT[13]=’C’
FL[13]=20
FD[13]=0

FN[14]=’Nama_Ayah’
FT[14]=’C’
FL[14]=20
FD[14]=0

FN[15]=’Nama_Ibu’
FT[15]=’C’
FL[15]=20
FD[15]=0

FN[16]=’Al_Ortu’
FT[16]=’C’
FL[16]=42
FD[16]=0

CREATE TEMP
FOR R = 1 TO 16
APPEND BLANK
REPL FIELD_NAME WITH FN[R],FIELD_TYPE WITH FT[R]
REPL FIELD_LEN WITH FL[R]
NEXT
CLOSE DATABASE
CREATE MHSISWA FROM TEMP
ERASE TEMP.DBF
CLOSE DATA
EndIf
Restore Screen From Independence
USE MHSISWA
IF ! FILE(‘MHSISWA.NTX’)
INDEX ON NOMOR TO MHSISWA
ENDIF
SET INDEX TO MHSISWA
RETURN

* -=-=-=-=-=-=-=-=-=-=-=-=-=
* CopyRight(c:)Armansyah 97
* -=-=-=-=-=-=-=-=-=-=-=-=-=

Categories: Clipper, Tak Berkategori | Tinggalkan komentar