Database connection with MSAcess Database and insert,update,delete,select commands in VB
Output is:
Source Code is:
Dim con As New ADODB.Connection
Dim rs As New ADODB.Recordset
Private Sub Combo1_Click()
rs.Open "select * from punch where Card_id='" & Combo1.Text & "' ", con, adOpenDynamic, adLockBatchOptimistic
While rs.EOF = False
Text1.Text = rs(0)
Text2.Text = rs(1)
rs.MoveNext
Wend
rs.Close
End Sub
Private Sub Command1_Click()
rs.Open "select * from punch where Card_id='12'", con, adOpenDynamic, adLockBatchOptimistic
While rs.EOF = False
Text1.Text = rs(0)
Text2.Text = rs(1)
rs.MoveNext
Wend
rs.Close
End Sub
Private Sub Command2_Click()
con.Execute "insert into punch values('" & Text1.Text & "','" & Text2.Text & "')"
MsgBox "inserted"
End Sub
Private Sub Command3_Click()
con.Execute "update punch set User_Name='" & Text2.Text & "' where Card_id='" & Text1.Text & "'"
MsgBox "updated"
End Sub
Private Sub Command4_Click()
con.Execute "delete from punch where Card_id='" & Text1.Text & "'"
MsgBox "deleted"
End Sub
Private Sub Form_Load()
con.ConnectionString = "provider=microsoft.jet.oledb.4.0;" & " data source=" & App.Path & "\pu.mdb"
con.Open
rs.Open "select Card_id from punch", con, adOpenDynamic, adLockBatchOptimistic
While rs.EOF = False
Combo1.AddItem rs(0)
rs.MoveNext
Wend
rs.Close
End Sub
ASP.NET is a development framework for building web pages and web sites with HTML, CSS, JavaScript and server scripting. ASP.NET supports three different development models: Web Pages, MVC (Model View Controller), and Web Forms.
Friday, October 10, 2008
Subscribe to:
Post Comments (Atom)
Using Authorization with Swagger in ASP.NET Core
Create Solution like below LoginModel.cs using System.ComponentModel.DataAnnotations; namespace UsingAuthorizationWithSwagger.Models { ...
-
using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.D...
-
<ControlTemplate x:Key="TextBoxBaseControlTemplate" TargetType="{x:Type TextBoxBase}"> <Borde...
-
<?xml version="1.0" encoding="utf-8"?> <Report xmlns:rd="http://schemas.microsoft.com/SQLServer/reporting...
No comments:
Post a Comment