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
 

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

Top