Results 1 to 3 of 3

Thread: New To DB

  1. #1

    Thread Starter
    Hyperactive Member
    Join Date
    Aug 2000
    Posts
    258
    I have a Microsoft Access Version 7 Dtabase Called "Users"
    Inside it is 1 Table with 2 fields 1 called "Nick" the other called "IPNumber" I have 2 text boxes that are linked to it on the form . The question is how can I add the text in those 2 boxes to the apropriate Feild in it Through Code ? I Can't have the user enter it manually . I nned basicaly an On Click add this user and IP to the DB .
    Any Help would be appreciated . Thanks guys

    []Private[]
    Visual Basic 6 SP4 on win98se

    QUIT THE RAT RACE BECAUSE YOUR MESSING THE WORLD UP !!!!!

  2. #2
    Lively Member
    Join Date
    Aug 2000
    Location
    Texas
    Posts
    88

    Wink

    ******** A brief sample how to display data in textboxes

    sql = "select user,ip from table_name"
    rs.open sql, objconnection

    txtUser.text = rs!user
    txtIP.text = rs!ip

    ******** How to insert a new record into the DB

    private sub cmdAdd_click()
    sql = "insert into table_name (user,ip) " _
    & "values('" & txtUser.text & "'," _
    & txtIP.text & ")"
    objcommand.commandtext = sql
    objcommand.commandtype = adcmdtext
    objcommand.activeconnection = objconnection
    objcommand.execute

    Hope you got an idea...

  3. #3

    Thread Starter
    Hyperactive Member
    Join Date
    Aug 2000
    Posts
    258
    Thanks For the tip .
    Visual Basic 6 SP4 on win98se

    QUIT THE RAT RACE BECAUSE YOUR MESSING THE WORLD UP !!!!!

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