Results 1 to 3 of 3

Thread: ADO!! i think

  1. #1

    Thread Starter
    New Member
    Join Date
    Jan 2005
    Posts
    9

    Question ADO!! i think

    I have created a MS access DB with 2 tables, PlayersDatabase and ManagerDetails

    I have used a data environment called FantasyFootballDB and 2 commands Players (PlayerDatabaseTbl) and Managers (ManagerDetailstbl) i have copied them over to my form and created navigational buttons which works fine. However i want to be able to add details in the textbox and click on the button so that the new player can be added to the database i have this but it doesnt work

    FantasyfootballDB.rsplayers.addnew

    im quessing i need more code for it work, be grateful with all and any help

  2. #2
    I'm about to be a PowerPoster! Hack's Avatar
    Join Date
    Aug 2001
    Location
    Searching for mendhak
    Posts
    58,333

    Re: ADO!! i think

    Investigate SQL. A simple INSERT INTO statment should work fine for you.

  3. #3
    Addicted Member makster246's Avatar
    Join Date
    Dec 2004
    Location
    nottingham
    Posts
    187

    Re: ADO!! i think

    ADO is a nasty little piece of work, that only works when it feels like it...i have similar programs all with similar code, some choose to work while others choose not to..

    unless i am needing to preform sql searchs, display into a datatable or have the database available to multiple users - i much prefer to use DAO

    contuary to what alot of people think DAO does still work with the new versions of MS Access, you simply have to go into project references and tell vb to use DAO 3.6....
    anyway now to the code...

    as started above first go into project preferences and tick the DAO 3.6

    dim mydata as DAO.Database
    dim myrecord as DAO.RECORDSET

    private sub command1_click()
    set mydata = open database("path to database")
    set myrecord = database.recordset("tablename)

    myrecord.Movelast
    myrecord.Add
    myrecord!NAME = "johnsmith" or text1.text
    myrecord.update

    end sub


    Rob

    hope this helps

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