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 biv343 on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

query with parameters from form in VB.net

Status
Not open for further replies.

WalfdPD

MIS
Apr 22, 2005
14
US
I am new to VB.net having used access 2000 to write most of my applications.

I have a simple query written with the Data Adapter Configuration Wizard. It has two parameters and works fine when it is run in the query builder view.
I want to run the query from a form and it runs fine without the parameters. However I want the parameter box to display so the user can enter his/her parameters and get the results he/she is looking for.

I presently have the following code attached to a button.
OleDbDataAdapter1.Fill(DataSet11)

Without the parameters it works fine returning all the records in the table. However with the parameters I get
this message;
An unhandled exception of type 'System.Data.OleDb.OleDbException' occurred in system.data.dll


What am I missing?

Can't seem to find the answer in MS help.

tks LTWHB
 
You need to show the code causing the error, and supply the full error message.
 
This is the full error message:
QueryTest\Form1.vb:line 1The program '[924] QueryTest.exe' has exited with code 0 (0x0).
 
Do you need to add the parameters, maybe something like this?
Code:
Dim parm As OleDbParameter = New OleDbParameter("ParmName", ParmValue)
OleDbDataAdapter.SelectCommand.Parameters.Add parm

Have a great day!

j2consulting@yahoo.com
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top