Re: Parameter Error

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance

From: Tom Nowak (TomNowak_at_discussions.microsoft.com)
Date: 07/07/04


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.
> >
> >
>
>
>



Relevant Pages

  • Re: Forms property using varables
    ... each command button opens the same form "form2" but displaying different ... i dont want to hard code P2602A, instead i want ti use a varable. ... when the command button is pressed on form1 it sets EquipmentTagString as ... Controls collection. ...
    (microsoft.public.access.formscoding)
  • Re: php-mysql
    ... >> login as root and give the following command ... > you could use apache2 but then I dont know where the config files are ... > I dont know which distribution you use, but in Debian Etch the files are ... server will only work on the server console till you tweek ...
    (Debian-User)
  • Re: Postfix, "From:" address, command line
    ... > I sometimes send mail through command line interface this way: ... But i really lost the file name, and dont know if it ... You could inject the mail using postfix's injection program. ...
    (Fedora)
  • creating a ftp account
    ... profile of this user to log in, ... I dont want to delete some ... files and change my current directory with "cd" command. ... NETMBX ...
    (comp.os.vms)