Imports System.Data
Imports System.Data.OleDb
Public Class salesinventoryrpt
Inherits System.Windows.Forms.Form
Dim bill As New POS
Dim mypath = Application.StartupPath & "\db1.accdb"
Dim connection As New OleDbConnection("Provider=Microsoft.ACE.OLEDB.12.0;Data Source=d:\db1.accdb;Persist Security Info=False;")
Dim cmd As OleDbCommand
Dim cmdGetIdentity = New OleDbCommand()
Dim sql2 As OleDbDataAdapter = New OleDbDataAdapter("Select * from sales", connection)
Dim db1 As DataSet = New DataSet
Dim db2 As New DataTable
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Try
db1.Clear()
db2.Clear()
cmdGetIdentity = connection.CreateCommand
cmdGetIdentity.CommandText = "SELECT * FROM sales where transac_date between '%" & (DateTimePicker1.Text) & "%' and '%" & (DateTimePicker2.Text) & "'"
sql2.SelectCommand = cmdGetIdentity
sql2.Fill(db1, "sales")
DataGridView1.DataSource = db1
DataGridView1.DataMember = "sales"
DataGridView1.ReadOnly = True
DataGridView1.SelectionMode = DataGridViewSelectionMode.FullRowSelect
DataGridView1.MultiSelect = False
DataGridView1.RowHeadersVisible = False
Catch ex As Exception
MsgBox("Error: " & ex.Source & ": " & ex.Message, MsgBoxStyle.OkOnly, "Connection Error !!")
End Try
End Sub
End Class
Error: microsoft office access database engine : no value give for one or more required parameters

New Topic/Question
Reply




MultiQuote

that is the screenshot, goddamn this problem, i think im already debugging it for 12 hours since yesterday still i get no luck for figuring out this out, here is the whole code sir, i already tried different code suggested by different people still i cant solve it , sir this is my software and the database in it, please kindly see it for me 


|