No value given for one or more required parameters

W

William Gower

I am getting this error on a line that fills the data adapter object with a
dataset


I have a SQL string that holds the sql statement

Dim da As New System.Data.OleDb.OleDbDataAdapter(strSQL,
strConnection)
da.Fill(ds, "requests")
DGRequests.DataSource = ds

Is the error telling me that I have a mistake in my sql statement?
 
J

Jason DeFontes

Yeah. Access is really bad when it comes to reporting syntax errors in
SQL statements. It thinks anything that it doesn't recognize as valid
table or column name is a parameter to be filled in at runtime (this
makes sense if you've ever done any development directly in Access), but
usually it's a syntax error, or you misnamed a column or something. Set
a breakpoint or print out your SQL statement and take a look and you'll
probably see the error. If not, try pasting it into a query in Access
and running it there, and it should tell you what it thinks is a parameter.

-Jason
 
Joined
Nov 11, 2009
Messages
1
Reaction score
0
Hi All,

I just got the same problem solved.

I was facing same problem with my MS ACCESS database.

The likely reason for that error could be that the field name in WHERE condition doesnt match the case as that of the database.

Regards,
Urvish
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,774
Messages
2,569,598
Members
45,151
Latest member
JaclynMarl
Top