Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Problems getting data from Access 2000 DB

Status
Not open for further replies.

enak

Programmer
Jul 2, 2002
412
US
Why can't I get the ExecuteReader to work? I keep getting the error:

No value given for one or more of required parameters.

What does this mean? I can connect to the database.

Here is my code:

Public Function getDataReader(ByRef sSQL As String) As OleDb.OleDbDataReader
Dim myCMD As OleDb.OleDbCommand
Dim dr As OleDb.OleDbDataReader

Try
cnn.Open()
myCMD = New OleDb.OleDbCommand(sSQL, cnn)

dr = myCMD.ExecuteReader()
Return dr
Catch ex As Exception
Throw ex
End Try

End Function


Thanks,
enak
 
Where is the connection string for the connection? You need to provide a connection string to the connection object before calling the open method

I used to rock and roll every night and party every day. Then it was every other day. Now I'm lucky if I can find 30 minutes a week in which to get funky. - Homer Simpson
 
Thanks, I figured that problem out. This is my first time working with MS Access. I am used to TSQL so I had to adjust my sql statement.

However, I have another problem. I don't know how to retrieve multiple selected items from a listbox. Do you know how to do that?

Thanks,
enak
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top