Visual Basic Help code

puertorico123puertorico123 Member Posts: 95 ■■□□□□□□□□
Hy, i make a GUI, in Visual Basic, to search a simple database. i use the orange book: "Build a program NOW!". i make a simple GUI with a "textbox" for entry input and then using a "button" for search. my goal is. input a "userid" in the tex box, and then search the list and display then in a "Label". the book have a seccion about Database, but is not have a form to make a search by input. thanks in advanced.

EDITED:
i make the GUI, but i need to make the code.
"textbox" = user enter a data "user id".
"buttom1" = user hits search button, and VB search a database from Access.
*the "user id" is the second field of the table.
then result the the other 4 fields. in the others "textbox".
** the others "textbox" was made, in drag and drop from the Datasource seccion of the VBasic 2005.

this is my practice in my firt programing.
HOLD:
Comptia A+
Comptia Network+

2009 Plan:
MCSA...75%
CCENT....0%
70-648..0%

2010 Plan:
MCITP
ORACLE

Comments

  • /usr/usr Member Posts: 1,768 ■■■□□□□□□□
    I'm not sure what you're asking here.

    When the user inputs the "user ID" into the text box and hits "Search", you would create a string variable and place whatever text that was in the text box, into the variable.

    You could then search whatever you're trying to search by comparing the contents of the variable against the database.

    Did that help?
  • puertorico123puertorico123 Member Posts: 95 ■■□□□□□□□□
    /usr wrote: »
    I'm not sure what you're asking here.

    When the user inputs the "user ID" into the text box and hits "Search", you would create a string variable and place whatever text that was in the text box, into the variable.

    You could then search whatever you're trying to search by comparing the contents of the variable against the database.

    Did that help?

    i make the GUI, but i need to make the code.
    "textbox" = user enter a data "user id".
    "buttom1" = user hits search button, and VB search a database from Access.
    *the "user id" is the second field of the table.
    then result the the other 4 fields. in the others "textbox".
    ** the others "textbox" was made, in drag and drop from the Datasource seccion of the VBasic 2005.
    HOLD:
    Comptia A+
    Comptia Network+

    2009 Plan:
    MCSA...75%
    CCENT....0%
    70-648..0%

    2010 Plan:
    MCITP
    ORACLE
  • /usr/usr Member Posts: 1,768 ■■■□□□□□□□
    I do not understand what you're asking for...the actual code?

    Highlight what you want help with and press "F1". Visual Studio has a nice online help resource.
  • tierstentiersten Member Posts: 4,505
    I've not used VB in years but last time I used it, there was an example project included that interfaced to an Access database.

    Is this your homework assignment?
  • coffeekingcoffeeking Member Posts: 305 ■■■■□□□□□□
    puertorico123,

    it has been a long time since I used VB but it appears to me that you don't actually have a connection to the database. when the search key (button) is pressed; there should be a process in the back end that has an established connection to the database so that you can lookup the information and display it in a label. Like I said it has been a long time since I did VB but I remember that there is a built-in functionality in VB (can't remember the name right now) that you have to use to make the connection to your Access DB and then test it to see, upon successful connection you get the confirmation message that you have a connection to the DB and then it is the easy part. I have done exactly what you are trying to do but a while back. if I am not wrong the built-in tool is called OLDB connection or something like that, look it up.
  • /usr/usr Member Posts: 1,768 ■■■□□□□□□□
    What you're trying to do cannot be explained briefly here, as it is more than just a matter of writing a few lines of code.

    Search the Visual Studio help for connecting to and searching an Access database.

    However, if what you're doing is that simple, why not just create a form within Access itself?

    I always used SQL queries to return the information I wanted.
  • puertorico123puertorico123 Member Posts: 95 ■■□□□□□□□□
    ok, i have a book "old book" for visual basic 6.0.
    but yes, are connected the database.

    i need to enable the search button. define a event.

    i attach the form:
    1. user put a user id.
    2. then hit "search"
    3. then result in the other "textbox".
    vb2.JPG 85.2K
    HOLD:
    Comptia A+
    Comptia Network+

    2009 Plan:
    MCSA...75%
    CCENT....0%
    70-648..0%

    2010 Plan:
    MCITP
    ORACLE
  • /usr/usr Member Posts: 1,768 ■■■□□□□□□□
  • elaverick1981elaverick1981 Member Posts: 161
    So you want to type somethng in the text box (student name for exam) and then have it return the other details associated with that student in the text boxes? Is that correct?
  • puertorico123puertorico123 Member Posts: 95 ■■□□□□□□□□
    So you want to type somethng in the text box (student name for exam) and then have it return the other details associated with that student in the text boxes? Is that correct?

    yes!.

    i have a little experencie in Qbasic, jajaja.
    HOLD:
    Comptia A+
    Comptia Network+

    2009 Plan:
    MCSA...75%
    CCENT....0%
    70-648..0%

    2010 Plan:
    MCITP
    ORACLE
  • elaverick1981elaverick1981 Member Posts: 161
    You might like to have a look at these -
    An Introduction to VB.NET and Database Programming - developer Fusion - Visual Basic, C# Programming, ASP.NET, .NET Framework and Java Tutorials
    Getting Started with ADO.NET

    You might want to learn a bit more VB.NET before proceeding with this project tho. While a bit of QBasic experience would have got you through VB6, VB.NET is quite different. You might find you struggle with some concepts.
Sign In or Register to comment.