RE: parameterized queries



Never mind.. figured it out..

"musclpete" wrote:

> sSelect = "Select name from ps_customer where setid='ASAG' and
> cust_id=?"
> Dim cmdQ As New System.Data.Odbc.OdbcCommand(sSelect, hQuest)
> cmdQ.CreateParameter()
> cmdQ.Parameters.Add("f", Data.Odbc.OdbcType.Char)
> tbfoo.Text = cmdQ.ExecuteScalar()
> Catch ex As Exception
> MessageBox.Show("Failed to connect to Quest" & ex.ToString)
> End Try

Here's the solution:
cmdQ.Parameters.Add("cust_id", Data.Odbc.OdbcType.Char).Value = tbfoo.Text
(and yes, I know it's not good design to prompt for the param and then to
overwrite with the fetch, but I'm just testing..)
.



Relevant Pages

  • Re: Conditional (Null Value) Macro wont run
    ... macro altogether. ... I can't produce any prompt at all. ... > On table props, design: I set five fields to 'required', yes. ... > Attached macro to form properties: ...
    (microsoft.public.access.macros)
  • Re: Text box validation
    ... if you would like a code-free solution to prevent Access saving the ... record if a value is not provided for this field, open the table in design ... rather than allenbrowne at mvps dot org. ... > when running the code the text box can be blank but no prompt occurs. ...
    (microsoft.public.access.forms)
  • Re: Allow/Deny saving of datasheet column widths and positions.
    ... Tips for Access users - http://allenbrowne.com/tips.html ... for queries but for datasheet forms I find that it automatically saves ... I noticed one of way of doing this is when the prompt "do you want to ... save changes to the design of form xxxxx" is brought up, ...
    (comp.databases.ms-access)
  • Re: [Full-disclosure] Yet another Dialog Spoofing Vulnerability - Firefox Basic Authenticati
    ... Although it's amusing Firefox filters '"' in this prompt to begin with, ... general complaint about browser design that is in no way specific to ...
    (Full-Disclosure)
  • Re: Unauthenticated user has server root access
    ... That is a wise suggestion... ... prompt a user to enter a password. ... and have total access. ... >> I know this is not by design, ...
    (microsoft.public.win2000.security)

Loading