n=conn. CommandText=cmd
ds As New DataSetda As New OleDbDataAdapter (c). Fill (ds, TableName). DataSource=ds. DataMember=TableName
SubModule
Код форми Form1Class Form1
'Private Sub Button1_Click (ByVal sender As System. Object, ByVal e As System. EventArgs) Handles Button1. Click
'RefreshGrid ()
'End SubSub RefreshGrid ()
'Dim c As New OleDbCommand
'c. Connection=conn
'c. CommandText=«select * from Фірми»
'Dim ds As New DataSet
'Dim da As New OleDbDataAdapter (c)
'da. Fill (ds, «Фірми»)
'Grid1. DataSource=ds
'Grid1. DataMember=«Фірми»
'Grid1. Columns («Код»). Visible=False (Grid1, «select * from Студенти», «Студенти»). Columns («Код»). Visible=FalseSub
Sub Form1_Load (ByVal sender As System. Object, ByVal e As System. EventArgs) Handles MyBase. LoadDBpath As String=Application. StartupPath & « BD1.accdb»=New OleDbConnection. ConnectionString=«Provider=Microsoft.ACE.OLEDB.12.0; Data Source=»& DBpath & »; Persist Security Info=False; ». Open () () Sub
Sub Button2_Click (ByVal sender As System. Object, ByVal e As System. EventArgs) Handles Button2. Clicks1, s2, s3, s4 As Stringr As DialogResult. ShowDialog ()=Form2. TextBox1. Text=Form2. TextBox2. Text=Form2. TextBox3. Text=Form2. TextBox4. Text
=Form2. DialogResult. Close ()
r <> DialogResult.OK ThenSubIf
c As New OleDbCommand. Connection=conn. CommandText=«insert into Студенти (П.І.Б., Група, Курс, Напрямок) values ??(« »& s1 &« »,« »& s2 &« »,« »& ; s3 & «», «» & s4 & «») ». ExecuteNonQuery ()
() Sub
Sub Button3_Click (ByVal sender As System. Object, ByVal e As System. EventArgs) Handles Button3. Clickk As Integerc As New OleDbCommand. Connection=conn=Grid1. CurrentRow. Cells («Код»). Value. CommandText=«delete from Студенти where Код =» & k. ExecuteNonQuery () () Sub Sub Grid1_CellClick (ByVal sender As Object, ByVal e As System. Windows. Forms. DataGridViewCellEventArgs) Handles Grid1. CellContentClick () SubSub RefreshGrid2 () k As Integer=Grid1. CurrentRow. Cells («Код»). Value (Grid2, «select * from Успішність where ID_студента =» & k, «Студенти»). Columns («Код»). Visible=False. Columns («ID_студента»). Visible=FalseSub
Sub Button5_Click (ByVal sender As System. Object, ByVal e As System. EventArgs) Handles Button5. Clicks1, s2, s3, s4, s5 As Stringr As DialogResult. ShowDialog ()=Grid1. CurrentRow. Cells («Код»). Value=Form3. TextBox2. Text=Form3. TextBox3. Text=Form3. TextBox4. Text=Form3. TextBox5. Text=Form3. DialogResult. Close ()
r <> DialogResult.OK ThenSubIf
Dim c As New OleDbCommand. Connection=conn. CommandText=«insert into Успішність (ID_студента, Предмет, Оцінка, Викладач, Семестр) values ??(« »& s1 &« »,« »& s2 &« »,« »& s3 & ; «», «» & s4 & «», «» &a...