Contoh Query Database di ASP

Contoh Query Database di ASP

<%
‘——————————————————————–
‘File ini bernama : persen_order_2_2006.asp
‘Tanggal Pembuatan : Rabu, 18 Juni 2003 Pkl. 15:22
‘ Programmer : Armansyah, S.Kom
‘Studi Kasus Sistem Informasi Manajemen Produksi PT. Rambang Palembang

‘armansyah.skom@gmail.com /arsiparmansyah.wordpress.com
‘——————————————————————–

‘————– Hitung Jumlah Semua data/Records yang ada ditabel OEF
Dim ActiveXDataObject_Connection
set ActiveXDataObject_Connection = Server.CreateObject(“ADODB.Connection”)
ActiveXDataObject_Connection.Open “DRIVER={Microsoft Access Driver (*.mdb)};uid=;pwd=akulahthebestcoy;DBQ=” & Server.MapPath(“databasenyo.mdb”)

Dim RecordSet_OEF
Set RecordSet_OEF = Server.CreateObject(“ADODB.Recordset”)

Dim SQL_TotalSemuaOef
SQL_TotalSemuaOef = “Select * from Tabel1”
RecordSet_OEF.Open SQL_TotalSemuaOef, ActiveXDataObject_Connection, adOpenStatic

Dim Total_Semua_OEF
Total_Semua_OEF = RecordSet_OEF.recordcount

RecordSet_OEF.Close

‘————– Hitung Jumlah data/Records yang sudah selesai proses
Dim SQL_Order_Selesai
SQL_Order_Selesai = “Select * from Tabel1 Where Tabel1.StatusOrder = ‘SUDAH SELESAI'”
RecordSet_OEF.Open SQL_Order_Selesai, ActiveXDataObject_Connection, adOpenStatic

Dim Total_Semua_OEFSELESAI
Total_Semua_OEFSELESAI = RecordSet_OEF.recordcount
RecordSet_OEF.Close

‘————– Hitung Jumlah data/Records yang belum selesai proses
Dim SQL_Order_Blm_Selesai
SQL_Order_Blm_Selesai = “Select * from Tabel1 Where Tabel1.StatusOrder <> ‘SUDAH SELESAI'”
RecordSet_OEF.Open SQL_Order_Blm_Selesai, ActiveXDataObject_Connection, adOpenStatic

Dim Total_Semua_OEFBLMSELESAI
Total_Semua_OEFBLMSELESAI = RecordSet_OEF.recordcount
RecordSet_OEF.Close

‘————– Hitung Jumlah data/Records yang batal oiy
Dim SQL_Order_yang_batal
SQL_Order_yang_batal = “Select * from Tabel1 Where Tabel1.StatusOrder = ‘BATAL'”
RecordSet_OEF.Open SQL_Order_yang_batal, ActiveXDataObject_Connection, adOpenStatic

Dim Total_Semua_OEFBatal
Total_Semua_OEFBatal = RecordSet_OEF.recordcount
RecordSet_OEF.Close

%>

Categories: Classic ASP | Tinggalkan komentar

Navigasi pos

Tinggalkan Balasan

Please log in using one of these methods to post your comment:

Logo WordPress.com

You are commenting using your WordPress.com account. Logout / Ubah )

Gambar Twitter

You are commenting using your Twitter account. Logout / Ubah )

Foto Facebook

You are commenting using your Facebook account. Logout / Ubah )

Foto Google+

You are commenting using your Google+ account. Logout / Ubah )

Connecting to %s

Buat situs web atau blog gratis di WordPress.com.

%d blogger menyukai ini: