SQL with ADODC ... please help me!

I have a database in access 2000 and an ODBC connected to it.

"Selected_Item" suports the ID of a record selected in the database by a TextBox.

Now, I want to create a query goes to the database and retrieves the lines on a certain table where that ID exists.

The ODBC has that possibility but when I try to do it, something goes wrong and the message:

"Invalid value was gives for one or more parameters".



Resume:

I want to do something like this:


Select Name,Phone,Adress from Adresses where ID = "Selected_Item"



Please help me couse with this I could finish my software in no time.

My e-amil: rolando@webdes-cv.com; rolando_araujo@mail.pt or rjma_cvman@hotmail.com

Thanks

Rolando Arajo

Comments

  • [b][red]This message was edited by grarun at 2005-4-21 12:3:56[/red][/b][hr]
    : I have a database in access 2000 and an ODBC connected to it.
    :
    : "Selected_Item" suports the ID of a record selected in the database by a TextBox.
    :
    : Now, I want to create a query goes to the database and retrieves the lines on a certain table where that ID exists.
    :
    : The ODBC has that possibility but when I try to do it, something goes wrong and the message:
    :
    : "Invalid value was gives for one or more parameters".
    :
    :
    :
    : Resume:
    :
    : I want to do something like this:
    :
    :
    : Select Name,Phone,Adress from Adresses where ID = "Selected_Item"
    :
    :
    :
    : Please help me couse with this I could finish my software in no time.
    :
    : My e-amil: rolando@webdes-cv.com; rolando_araujo@mail.pt or rjma_cvman@hotmail.com
    :
    : Thanks
    :
    : Rolando Arajo
    :



    There may be some type mismatch. Sice U didn't show us the exact code
    Your Query statement must be like this.

    If ID is a string type(varchar) then

    "Select Name,Phone,Adress from Adresses where ID = '" & textbox.text "'"

    if it is a numeric value

    "Select Name,Phone,Adress from Adresses where ID = " & textbox.text

    hope this helps U.







  • : I have a database in access 2000 and an ODBC connected to it.
    :
    : "Selected_Item" suports the ID of a record selected in the database by a TextBox.
    :
    : Now, I want to create a query goes to the database and retrieves the lines on a certain table where that ID exists.
    :
    : The ODBC has that possibility but when I try to do it, something goes wrong and the message:
    :
    : "Invalid value was gives for one or more parameters".
    :
    :
    :
    : Resume:
    :
    : I want to do something like this:
    :
    :
    : Select Name,Phone,Adress from Adresses where ID = "Selected_Item"
    :
    :
    :
    : Please help me couse with this I could finish my software in no time.
    :
    : My e-amil: rolando@webdes-cv.com; rolando_araujo@mail.pt or rjma_cvman@hotmail.com
    :
    : Thanks
    :
    : Rolando Arajo
    :
    ----------------------------------------------------------------
    hi,
    first be sure that your sql is right
    copy and paste this in to your code:

    "Select Name,Phone,Adress from Adresses where ID =&'"Selected_Item"' &"'"

    you must supply the right parameters in the right syntax

    OR
    you can find your request at www.softricks.5u.com
Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories