By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
443,640 Members | 1,331 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 443,640 IT Pros & Developers. It's quick & easy.

OleDbexception error?

P: n/a
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.
Nov 20 '05 #1
Share this question for a faster answer!
Share on Google+

This discussion thread is closed

Replies have been disabled for this discussion.