Hello,
I have the following SQL statement in an OleDbDataAdapter:
SELECT Customers.Watch, Format(FinStmts.[Expiration Date], 'MM/DD/YY') AS ExpDate, Customers.FullName, Customers.Phone1, Customers.SSN, FinStmts.RecordID
FROM ((Officer INNER JOIN
FinStmts ON Officer.RecordID = FinStmts.OfficerID) INNER JOIN
Customers ON FinStmts.CustomerID = Customers.RecordID)
WHERE (FinStmts.[Expiration Date] < NOW()) AND (Officer.RecordID = ?) AND (NOT (FinStmts.[Expiration Date] IS NULL))
In my code I have:
Dim OfficerID As Long
OfficerId=9
Dim par As New OleDbParameter("RecordID", OleDbType.Integer)
par.Value = OfficerID
OleDbdaCCTickler.SelectCommand.Parameters.Add(par)
OleDbdaCCTickler.Fill(DsCCTickler1)
dgTickler.DataBind()
I get the following error:
ERROR: System.Data.OleDb.OleDbException: Parameter ?_1 has no default value. at System.Data.OleDb.OleDbCommand.ExecuteCommandTextE rrorHandling(Int32 hr) at .
In the Parameter Collection Editor of the DataAdapter I have:
Members: (0)=RecordID
With the properties:
Direction=Input
OleDbType=Integer
Precision=0
Scale=0
Size=0
SourceColumn=RecordID
SourceVersion=Current
Value=
Parametername = RecordID
All I am trying to do is pass the parameter to the DataAdapter.
I am using an MS Access database.