Results 1 to 8 of 8

Thread: Reading from Database

  1. #1

    Thread Starter
    Hyperactive Member Stiletto's Avatar
    Join Date
    Aug 2002
    Location
    Jerusalem, Israel
    Posts
    287

    Reading from Database

    I got this so far:
    VB Code:
    1. Set DB = OpenDatabase(App.Path & "\Stilo.mdb")
    2.   'Open the Contact table
    3.   Set RS = DB.OpenRecordset("SELECT * FROM Contact WHERE # = '" & 5 & "'")
    4.  
    5. What do i do next?
    6. How do i read the value to a textbox?

  2. #2
    Fanatic Member vishalmarya's Avatar
    Join Date
    Feb 2001
    Location
    New Delhi , INDIA
    Posts
    858

    Re: Reading from Database

    Originally posted by Stiletto
    I got this so far:
    How do i read the value to a textbox?
    [/Highlight]
    Not clear ,

    u mean write to textbox
    Vishal Marya, MCP .net 3.5
    My Site
    http://www.vstoolsgallery.com/
    http://visualstudiogallery.msdn.micr...b-f87a909b9266





    Please indicate what version of vb you use.
    Please mark your thread resolved using the Thread Tools above.
    -----------------------------------------

  3. #3

    Thread Starter
    Hyperactive Member Stiletto's Avatar
    Join Date
    Aug 2002
    Location
    Jerusalem, Israel
    Posts
    287
    i'm using ADO.
    How can i read the fields and write it to a textbox (or label...whatever)

  4. #4
    Fanatic Member vishalmarya's Avatar
    Join Date
    Feb 2001
    Location
    New Delhi , INDIA
    Posts
    858
    Originally posted by Stiletto
    i'm using ADO.
    How can i read the fields and write it to a textbox (or label...whatever)

    Ado or dao does not matter ,
    u will be creating a recordset as in this case ,


    text1 = RS!fieldname

    or

    text1 = RS.fields("fieldname").

    u have 1605 posts to your name , what were they related to !! just curious
    Vishal Marya, MCP .net 3.5
    My Site
    http://www.vstoolsgallery.com/
    http://visualstudiogallery.msdn.micr...b-f87a909b9266





    Please indicate what version of vb you use.
    Please mark your thread resolved using the Thread Tools above.
    -----------------------------------------

  5. #5

    Thread Starter
    Hyperactive Member Stiletto's Avatar
    Join Date
    Aug 2002
    Location
    Jerusalem, Israel
    Posts
    287
    lol.
    Many things, but i'm new to all the database things...

  6. #6

    Thread Starter
    Hyperactive Member Stiletto's Avatar
    Join Date
    Aug 2002
    Location
    Jerusalem, Israel
    Posts
    287

    hmmm

    I had this b4:
    VB Code:
    1. frmMain.Text5.Text = "" & RS!Artist
    Wwhat is the blank space for?

  7. #7
    Fanatic Member vishalmarya's Avatar
    Join Date
    Feb 2001
    Location
    New Delhi , INDIA
    Posts
    858

    Re: hmmm

    Originally posted by Stiletto
    I had this b4:
    VB Code:
    1. frmMain.Text5.Text = "" & RS!Artist
    Wwhat is the blank space for?
    frmMain.Text5.Text = "" & RS!Artist

    or

    frmMain.Text5.Text = RS!Artist


    doesn't make any difference
    Vishal Marya, MCP .net 3.5
    My Site
    http://www.vstoolsgallery.com/
    http://visualstudiogallery.msdn.micr...b-f87a909b9266





    Please indicate what version of vb you use.
    Please mark your thread resolved using the Thread Tools above.
    -----------------------------------------

  8. #8
    Hyperactive Member
    Join Date
    Nov 2001
    Location
    Albany, NY
    Posts
    489
    it does nothing. Get rid of it.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width