Results 1 to 5 of 5

Thread: Creating a database to store scores?

  1. #1

    Thread Starter
    Fanatic Member paralinx's Avatar
    Join Date
    Jun 2005
    Location
    Michigan
    Posts
    987

    Creating a database to store scores?

    Hey all,

    I have created a game for 1st grade kids and I need a way to store the kid's highscores after they finish the game, so the other kids have something to shoot for when they play the game. I have see in other posts stuff about databases, but I know nothing about them. What would be the best way to store and then send back to my program about 600 "high scores" from 30 computers?

    thanks

  2. #2
    Super Moderator si_the_geek's Avatar
    Join Date
    Jul 2002
    Location
    Bristol, UK
    Posts
    41,974

    Re: Creating a database to store scores?

    For an intro to using DB's from VB, see the "ADO Tutorial" link below. The code isn't quite what you want, but is close enough to help you understand.

    As long as the database is on the same network as the computers the program is being run on, you should have no problems working with it.

  3. #3

    Thread Starter
    Fanatic Member paralinx's Avatar
    Join Date
    Jun 2005
    Location
    Michigan
    Posts
    987

    Re: Creating a database to store scores?

    thanks that helped a lot,

    however I have one question.

    Is there a way to clear all of the data of the fields, so I can rewrite them?

  4. #4
    VB Guru ganeshmoorthy's Avatar
    Join Date
    Dec 2005
    Location
    Sharjah, United Arab Emirates
    Posts
    3,031

    Re: Creating a database to store scores?

    Yes, you can delete all the records and add new ones or you can edit the field values with the new ones...you can decide which you want to use...

    VB Code:
    1. Sql = "Delete From <TableName>
    2.     'with a condition
    3.     Sql = "Delete From <TableName> Where <FieldName> = <Value>
    4.     'then perform the Delete
    5.     Cn.Execute Sql
    6.  
    7.     'To Update/Edit
    8.     Sql = "Update <TableName> Set <FieldName> = <Value>
    9.     Sql = Sql & " Where <FieldName> = <Value>
    10.     Cn.Execute Sql
    If an answer to your question has been helpful, then please, Rate it!

    Have done Projects in Access and Member management systems using BioMetric devices, Smart cards and BarCodes.


  5. #5
    Hyperactive Member Vishalgiri's Avatar
    Join Date
    Oct 2003
    Location
    India
    Posts
    345

    Re: Creating a database to store scores?

    If you want to clear all the field then better option will be renaming the database file (if it is MDB) or you can backup the database and keep a empty database and copy it to your database whenever you want to do so..

    I hope you got my idea
    Regards,
    Vishalgiri Goswami
    Gujarat, ( INDIA ).
    ---------------------

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