con.ConnectionString = "Provider=Microsoft.ACE.OLEDB.12.0;Data Source= C:\Users\admim\Desktop\ฐานข้อมูล31.accdb"
con.Open()
Dim ds As New DataSet
Dim dt As New DataTable
ds.Tables.Add(dt)
Dim da As New OleDbDataAdapter
da = New OleDbDataAdapter("SELECT * FROM query3", con)
da.Fill(dt)
DataGridView1.DataSource = dt.DefaultView
con.Close()
con.ConnectionString = "Provider=Microsoft.ACE.OLEDB.12.0;Data Source= C:\Users\admim\Desktop\ฐานข้อมูล31.accdb"
con.Open()
Dim ds As New DataSet
Dim dt As New DataTable
ds.Tables.Add(dt)
Dim da As New OleDbDataAdapter
da = New OleDbDataAdapter("SELECT * FROM query3", con)
da.Fill(dt)
DataGridView1.DataSource = dt.DefaultView
con.Close()
SELECT Query1.Product_Name, Query1.Categort_Name, Query1.LastUpdate, Query1.SumOfPieces AS Total, Query2.SumOfPieces AS Rental, [Total]-Nz([Rental]) AS Balance, [Total]-Nz([Rental]) AS TT
FROM Query1 INNER JOIN Query2 ON Query1.ID = Query2.ID;