Warning: mysqli_connect() [function.mysqli-connect]: (28000/1045): Access denied for user 'itprojec_abhi'@'localhost' (using password: YES) in /home1/itprojectsco/public_html/includes/database.php on line 13
Ready Project |BCA Project | MCA Project | BBA Project | MBA Project |INDIA'S BIGGEST COLLEGE PROJECT STORE
Option Explicit

Dim C As New Connection
Dim R As New Recordset
Dim S As String
Dim tot As Integer
Private Sub cmdAdd_Click()
txtPcode.Text = ""
txtPname.Text = ""
txtQty.Text = ""
txtPrice.Text = ""
txtTotal.Text = ""
txtPcode.SetFocus
End Sub

Private Sub cmdNext_Click()
R.MoveNext
If Not R.EOF Then
txtPcode.Text = R.Fields(0).Value
txtPname.Text = R.Fields(1).Value
txtQty.Text = R.Fields(2).Value
txtPrice.Text = R.Fields(3).Value
txtTotal.Text = R.Fields(4).Value
Else
MsgBox "No More Records!", vbInformation, "Product"
End If
End Sub
Private Sub cmdPrev_Click()
R.MovePrevious
If Not R.BOF Then
txtPcode.Text = R.Fields(0).Value
txtPname.Text = R.Fields(1).Value
txtQty.Text = R.Fields(2).Value
txtPrice.Text = R.Fields(3).Value
txtTotal.Text = R.Fields(4).Value
Else
MsgBox "No More Records!", vbInformation, "Product"
End If
End Sub
Private Sub cmdSave_Click()
R.Close
S = "Insert Into prodData Values(" & Val(txtPcode.Text) & ",'" & txtPname.Text & "'," & Val(txtQty.Text) & ", " & Val(txtPrice.Text) & "," & Val(txtTotal.Text) & ")"
R.Open S, C, adOpenDynamic, adLockOptimistic
S = "Select * From prodData"
R.Open S, C, adOpenDynamic, adLockOptimistic
If Not R.BOF And Not R.EOF Then
R.MoveFirst
txtPcode.Text = R.Fields(0).Value
txtPname.Text = R.Fields(1).Value
txtQty.Text = R.Fields(2).Value
txtPrice.Text = R.Fields(3).Value
txtTotal.Text = R.Fields(4).Value
End If
MsgBox "Product Added Successfully!", vbInformation, "Product"
End Sub
Private Sub cmdUpdate_Click()
R.Close
If txtPcode.Text = 100 Then
S = "Update prodData Set pno = '" & txtPname.Text & "', pname = '" & txtPname.Text & "',qty=" & Val(txtQty.Text) & ",price=" & Val(txtPrice.Text) & "',totalprice=" & Val(txtTotal.Text) & " Where pno = " & Val(txtPcode.Text)
R.Open S, C, adOpenDynamic, adLockOptimistic
S = "Select * From prodData"
R.Open S, C, adOpenDynamic, adLockOptimistic
If Not R.BOF And Not R.EOF Then
R.MoveFirst
txtPcode.Text = R.Fields(0).Value
txtPname.Text = R.Fields(1).Value
txtQty.Text = R.Fields(2).Value
txtPrice.Text = R.Fields(3).Value
txtTotal.Text = R.Fields(4).Value
End If
MsgBox "Product Updated Successfully!", vbInformation, "Product"
Else
S = "Select * From prodData"
R.Open S, C, adOpenDynamic, adLockOptimistic
If Not R.BOF And Not R.EOF Then
R.MoveFirst
txtPcode.Text = R.Fields(0).Value
txtPname.Text = R.Fields(1).Value
txtQty.Text = R.Fields(2).Value
txtPrice.Text = R.Fields(3).Value
txtTotal.Text = R.Fields(4).Value
End If
MsgBox "Product Not updated!", vbInformation, "Product"
End If
End Sub

Private Sub Form_Load()
S = "Select * From prodData"
C.Open "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=E:\VBSlipSol\Slip13\Ques-2\prod.mdb;Persist Security Info=False"
R.Open S, C, adOpenDynamic, adLockOptimistic
If Not R.BOF And Not R.EOF Then
R.MoveFirst
txtPcode.Text = R.Fields(0).Value
txtPname.Text = R.Fields(1).Value
txtQty.Text = R.Fields(2).Value
txtPrice.Text = R.Fields(3).Value
txtTotal.Text = R.Fields(4).Value
End If
End Sub

Private Sub txtPrice_Change()
txtTotal = Val(txtQty.Text) * Val(txtPrice.Text)
End Sub

Search

Project Categories


    Warning: mysqli_query() expects parameter 1 to be mysqli, boolean given in /home1/itprojectsco/public_html/includes/sidebar.php on line 30

    Warning: mysqli_fetch_assoc() expects parameter 1 to be mysqli_result, null given in /home1/itprojectsco/public_html/includes/sidebar.php on line 32

Recent Posts


Warning: mysqli_query() expects parameter 1 to be mysqli, boolean given in /home1/itprojectsco/public_html/includes/widget.php on line 5

Warning: mysqli_fetch_assoc() expects parameter 1 to be mysqli_result, null given in /home1/itprojectsco/public_html/includes/widget.php on line 7

Sign In