Field | Tipe Data |
user_login_id | varchar(50) * |
user_name | varchar(100) |
user_psw | varchar(20) |
Field | Tipe Data |
---|---|
product_id | varchar(40) * |
product_name | varchar(100) |
price | double |
stock | integer |
Fields | Tipe Data |
---|---|
no_transaksi | integer (auto increment) * |
tgl_transaksi | datetime |
total_barang | integer |
total_harga | double |
kasir | varchar(50) |
Fields | Tipe Data |
---|---|
no_transaksi | integer |
product_id | varchar(40) |
jumlah | integer |
harga_satuan | double |
Fields | Tipe Data |
---|---|
no_transaksi | integer |
product_id | varchar(40) |
jumlah | integer |
harga_satuan | double |
user_login_id | user_name | user_psw |
---|---|---|
admin | Administrator | admin |
Komponent | Properties |
---|---|
Form1 | Name : main_form Caption : Administration |
Label1 | Caption : Welcome, |
Label2 | Name : label_user Caption : User |
Command1 | Name : btn_user Caption : User |
Command2 | Name : btn_product Caption : Product |
Command3 | Name : btn_trans Caption : Transaksi |
Command4 | Name : btn_report Caption : Report |
Dim con As ADODB.Connection
Dim pathDb As String
pathDb = "\\compServer\dbStok.mdb"
con.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source="
& pathDb & ";Persist Security Info=False"
con.Open
Service
|
Port
|
HTTP | 80 |
FTP | 20,21 |
GOPHER | 70 |
SMTP | 25 |
POP3 | 110 |
TELNET | 23 |
FINGER | 79 |
LOCAL LOOPS/CALLBACKS | 0 |
Option Explicit Private Sub cmdClose_Click() Winsock1.Close shpGo.Visible = False shpWait.Visible = False shpError.Visible = True End Sub Private Sub cmdConnect_Click() Winsock1.RemoteHost = "11.0.0.1" 'Change this to your host ip Winsock1.RemotePort = 1007 Winsock1.Connect shpGo.Visible = True txtItem.SetFocus End Sub Private Sub cmdSend_Click() If Winsock1.State = sckConnected Then Winsock1.SendData txtItem.Text shpGo.Visible = True Label3.Caption = "Sending Data" Else shpGo.Visible = False shpWait.Visible = False shpError.Visible = True Label3.Caption = "Not currently connected to host" End If End Sub Private Sub Winsock1_DataArrival(ByVal bytesTotal As Long) Dim sData As String Winsock1.GetData sData, vbString 'Label1.Caption = sData txtPrice.Text = sData Label3.Caption = "Received Data" shpGo.Visible = True shpWait.Visible = False shpError.Visible = False End Sub Private Sub Winsock1_SendComplete() Label3.Caption = "Completed Data Transmission" End Sub
' Get clients request from database strData = "Item = '" & sItemData & "'" rs.Open "select * from prices", strConnect, adOpenKeyset,adLockOptimistic rs.Find strData strOutData = rs.Fields("Price")
Option Explicit Dim iSockets As Integer Dim sServerMsg As String Dim sRequestID As String Private Sub Form_Load() Form1.Show lblHostID.Caption = Socket(0).LocalHostName lblAddress.Caption = Socket(0).LocalIP Socket(0).LocalPort = 1007 sServerMsg = "Listening to port: " & Socket(0).LocalPort List1.AddItem (sServerMsg) Socket(0).Listen End Sub Private Sub socket_Close(Index As Integer) sServerMsg = "Connection closed: " & Socket(Index).RemoteHostIP List1.AddItem (sServerMsg) Socket(Index).Close Unload Socket(Index) iSockets = iSockets - 1 lblConnections.Caption = iSockets End Sub Private Sub socket_ConnectionRequest(Index As Integer, ByVal requestID As Long) sServerMsg = "Connection request id " & requestID & " from " & Socket(Index).RemoteHostIP If Index = 0 Then List1.AddItem (sServerMsg) sRequestID = requestID iSockets = iSockets + 1 lblConnections.Caption = iSockets Load Socket(iSockets) Socket(iSockets).LocalPort = 1007 Socket(iSockets).Accept requestID End If End Sub Private Sub socket_DataArrival(Index As Integer, ByVal bytesTotal As Long) Dim sItemData As String Dim strData As String Dim strOutData As String Dim strConnect As String ' get data from client Socket(Index).GetData sItemData, vbString sServerMsg = "Received: " & sItemData & " from " & Socket(Index).RemoteHostIP & "(" & sRequestID & ")" List1.AddItem (sServerMsg) 'strConnect = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=G:\Prices.mdb;Persist Security Info=False" Dim strPath As String 'Change the database path in the text file Dim fso As New FileSystemObject, txtfile, _ fil1 As File, ts As TextStream Set fil1 = fso.GetFile("path.txt") ' Read the contents of the file. Set ts = fil1.OpenAsTextStream(ForReading) strPath = ts.ReadLine ts.Close Set fso = Nothing strConnect = "Provider=Microsoft.Jet.OLEDB.4.0;" & _ "Persist Security Info=False;Data Source=" & strPath & _ "; Mode=Read|Write" Dim rs As New ADODB.Recordset ' Get clients request from database strData = "Item = '" & sItemData & "'" rs.Open "select * from prices", strConnect, adOpenKeyset, adLockOptimistic rs.Find strData strOutData = rs.Fields("Price") 'send data to client sServerMsg = "Sending: " & strOutData & " to " & Socket(Index).RemoteHostIP List1.AddItem (sServerMsg) Socket(Index).SendData strOutData End Sub