Re: Parameter Error
From: Tom Nowak (TomNowak_at_discussions.microsoft.com)
Date: 07/07/04
- Next message: One Handed Man \( OHM - Terry Burns \): "Re: Simple 3 tier stuff"
- Previous message: William Ryan eMVP: "Re: DataTable.NewRow and DataTable.LoadDataRow"
- In reply to: William \(Bill\) Vaughn: "Re: Parameter Error"
- Next in thread: William \(Bill\) Vaughn: "Re: Parameter Error"
- Reply: William \(Bill\) Vaughn: "Re: Parameter Error"
- Messages sorted by: [ date ] [ thread ]
Date: Wed, 7 Jul 2004 06:24:02 -0700
I figured out the 1st one, but not the 2nd question:
2nd question:
I dont want to write 17 sets of code for the 17 options a user can choose. I want to write a statement something like:
drw2("1") = xx
but I want the 1 to be cboChoice.Text, but I do not know how to format the command.
"William (Bill) Vaughn" wrote:
> Can we see the SQL query with the parameter markers?
>
> --
> ____________________________________
> William (Bill) Vaughn
> Author, Mentor, Consultant
> Microsoft MVP
> www.betav.com
> Please reply only to the newsgroup so that others can benefit.
> This posting is provided "AS IS" with no warranties, and confers no rights.
> __________________________________
>
> "Tom Nowak" <TomNowak@discussions.microsoft.com> wrote in message
> news:0F061AEA-D89C-4ECC-8097-EE2725F25E9F@microsoft.com...
> > I am writing a VB program, and on one particular form, I want to update a
> database based on a calculation, and the user inputting a number in a combo
> box on a form. In my table, the field names are name, 1-17, and total.
> >
> > Here is a sample of the parameter definitions
> >
> > Dim prm4 As OleDb.OleDbParameter = _
> > dap2.UpdateCommand.Parameters.Add("@name", _
> > System.Data.OleDb.OleDbType.VarChar, 25, "name")
> >
> > Dim prm5 As OleDb.OleDbParameter = _
> > dap2.UpdateCommand.Parameters.Add("@1", _
> > System.Data.OleDb.OleDbType.Integer, "1")
> >
> > all the way to 17, and total.
> >
> > 1st question: When I run the program, the user enters 1 in the combo box,
> I receive:
> > Parameter ?_2 has no defaut value.
> >
> > I want the program to leave the value in field 2 in the database alone.
> >
> > 2nd question:
> >
> > I dont want to write 17 sets of code for the 17 options a user can choose.
> I want to write a statement something like:
> > drw2("1") = xx
> > but I want the 1 to be cboChoice.Text, but I do not know how to format the
> command.
> >
> > Please help.
> >
> >
>
>
>
- Next message: One Handed Man \( OHM - Terry Burns \): "Re: Simple 3 tier stuff"
- Previous message: William Ryan eMVP: "Re: DataTable.NewRow and DataTable.LoadDataRow"
- In reply to: William \(Bill\) Vaughn: "Re: Parameter Error"
- Next in thread: William \(Bill\) Vaughn: "Re: Parameter Error"
- Reply: William \(Bill\) Vaughn: "Re: Parameter Error"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|