????U„Uˆ???? ??U„U…U†U ??U„ UŠ????????U… U‚???????? ??UŠ??U†???? ??Uƒ???? Uˆ U†U…Uˆ???? ????U†??U…?? ????????U„ ??UŠ??U†????
U…U„???-????:??U…UŠ?? ??U„?????????! ??U„U…U„UˆU†?? ??Uƒ???? U UŠ ?????? Uˆ???-??
Dim ac As New OleDb.OleDbConnection
Dim acons As String
Dim ds As New DataSet
Dim sq As String
acons = "provider=microsoft.jet.oledb.4.0;" + "data source=f:\d_student\db1.mdb;"
ac.ConnectionString = acons
sq = " select no,name,tm,se,nat,mm,class,dr,mn from g1"
Try
ac.Open()
If TextBox1.Text = "" Then Exit Sub
Dim da As New OleDb.OleDbDataAdapter(sq, ac)
da.Fill(ds)
ds.Tables(0).Rows.Add(New Object() {TextBox1.Text, TextBox2.Text, ComboBox1.Text, ComboBox2.Text, TextBox3.Text, ComboBox2.Text, ComboBox3.Text, ComboBox4.Text, TextBox5.Text})
Dim cb As New OleDb.OleDbCommandBuilder(da)
da.SelectCommand = cb.GetInsertCommand
da.Update(ds)
MsgBox("U„U‚?? ??U… ?-U ?? ??U„??UŠ??U†???? ??U†?????- ("
Catch ex As Exception
End Try
ac.Close()
????U„Uˆ???? ??U„U…U†U ??U„ UŠ????????U… U‚???????? ??UŠ??U†???? ??Uƒ???? Uˆ U†U…Uˆ???? ????U†??U…?? ???-?< ??U† ??UŠ??U†????
TextBox1.Text = "" : TextBox2.Text = ""
TextBox3.Text = "" : TextBox4.Text = ""
TextBox5.Text = "" : ComboBox1.Text = ""
ComboBox2.Text = "": ComboBox3.Text = ""
ComboBox4.Text = ""
Dim sr As Object
sr = InputBox("??????U„ ??U‚U… U‚UŠ?? ??U„????U„?? ??U„??UŠ ????UŠ?? ??U„???-?< ??U†??", "???-?<")
Dim ac As New OleDb.OleDbConnection
Dim acost As String
Dim sq As String
Dim ds As New DataSet
acost = "provider=microsoft.jet.oledb.4.0;" + "data source=f:\d_student\db1.mdb;"
sq = "select * from g1 where [no]= " & "'" & sr & "'"
ac.ConnectionString = acost
Try
ac.Open()
Dim da As New OleDb.OleDbDataAdapter(sq, ac)
da.Fill(ds, "g1")
TextBox1.Text = (ds.Tables("g1").Rows(0)("no"))
TextBox2.Text = (ds.Tables("g1").Rows(0)("name"))
TextBox3.Text = (ds.Tables("g1").Rows(0)("tm"))
ComboBox1.Text = (ds.Tables("g1").Rows(0)("se"))
ComboBox2.Text = (ds.Tables("g1").Rows(0)("nat"))
ComboBox3.Text = (ds.Tables("g1").Rows(0)("mm"))
ComboBox4.Text = (ds.Tables("g1").Rows(0)("class"))
TextBox4.Text = (ds.Tables("g1").Rows(0)("dr"))
TextBox5.Text = (ds.Tables("g1").Rows(0)("mn"))
Catch ex As Exception
MsgBox("U„??UŠUˆ????")
End Try
ac.Close()
End Sub
????U„Uˆ???? ??U„U…U†U ??U„ UŠ????????U… U‚???????? ??UŠ??U†???? ??Uƒ???? Uˆ U†U…Uˆ???? ????U†??U…?? ???-?< ??U† ??UŠ??U†????
Dim ac As New OleDb.OleDbConnection
Dim acons As String
Dim ds As New DataSet
Dim sq As String
acons = "provider=microsoft.jet.oledb.4.0;" + "data source=f:\d_student\db1.mdb;"
ac.ConnectionString = acons
sq = " select * from g1"
Try
ac.Open()
Dim da As New OleDb.OleDbDataAdapter(sq, ac)
da.Fill(ds, "g1")
DataGridView1.AutoSizeColumnsMode = DataGridViewAutoSizeColumnsMode.AllCells
DataGridView1.Rows.Clear()
Dim i As Integer
For i = 1 To ds.Tables("g1").Rows.Count - 1
DataGridView1.DataSource = ds.Tables("g1")
Next i
Catch ex As Exception
End Try
DataGridView1.Refresh()
ac.Close()
no | name | tm | se | nat | mm | class | dr | mn |
100 | U…?-U…?? ?????? ??U„??U„??U… U…?-U…?? ??U„UŠ | 12/8/1985 | ??Uƒ?? | U„UŠ??UŠ | ????????U„?? | ??U„??U†UŠ | 1/1/2003 | U…U†U‰ |
50 | U‡??U†UŠ U…?-U…?? ????U„U… U…?-U…Uˆ?? | 1/1/1990 | ??Uƒ?? | U…????UŠ | ??U„U‚??U‡???? | ??U„??U„?< | 2/2/2001 | U„UŠU„UŠ |
101 | U…U†UŠ?? U…?-U…?? ??????Uˆ | 12/8/1988 | ??Uƒ?? | U…????UŠ | ????????U„?? | ??U„???????? | 9/5/2005 | U†????UŠU† |
120 | ??U„????UŠU„ U†????UŠ U…?-U…Uˆ?? | 12/8/1999 | ??U†? | ??????U‚UŠ | ????????U„?? | ??U„????U…?? | 1/8/2005 | U†??U…UŠU† |
155 | U…??UˆU‡ U ???? U…U ?????- | 6/6/1988 | ??U†? | ??UˆU†??UŠ | ??U†??????UŠ | ??U„??U†UŠ | 2/9/2006 | U…??UŠU… |
24 | U…????U‡?? U…?-U…?? | 1980 | ??Uƒ?? | U…????UŠ | ????????U„?? | ??U„??U„?< | 12/8/1980 | U†Uˆ??U„ |
????UƒUŠ???? ????UˆU„ U‚???????? ??U„??UŠ??U†????
Patch ( D:\student\db1.mdb)
Database Name ( db1.mdb)
Table Name ( g1)