Advertisement
If you have a new account but are having problems posting or verifying your account, please email us on hello@boards.ie for help. Thanks :)
Hello all! Please ensure that you are posting a new thread or question in the appropriate forum. The Feedback forum is overwhelmed with questions that are having to be moved elsewhere. If you need help to verify your account contact hello@boards.ie

Programming Project Please Help!!

Options
  • 28-06-2005 3:29pm
    #1
    Registered Users Posts: 8,676 ✭✭✭


    Ok here's my situation, I have a database (Incidentally its Ms Access Db) right which holds information on prize draws that have taken place for safety. What I need to do is have computerised draw process, where the user can just press a button to produce a winner. Now I was thinking of programming this in java right as I have good knowledge in this, furthermore I thought I could create an ODBC between the db and the program. What it is right then if you have won a draw in lets say 1995 and the draw takes place in 2005 that effectively means that you go in ten times, where as if you have won the draw in 2004 you only go in once. Any ideas lads would be much appreciated.

    Regards

    Willem d


Comments

  • Registered Users Posts: 5,102 ✭✭✭mathie


    I think a bit more information might be required.

    "that effectively means that you go in ten times"

    go in what?

    Are you looking for advice on how to program this or what language would best be suited?

    M


  • Registered Users Posts: 1,679 ✭✭✭scargill


    i've seen some loose specs in my time but this takes the biscuit ?!

    could you explain that again please :confused:


  • Registered Users Posts: 8,676 ✭✭✭Chong


    Thanks for your swift reply Mathie, ok the ten times bit means the persons name goes into the draw ten times. Effectively for arguments sake if I haven't won the prize draw since 1950 my name would be in the prize draw 55 times when the draw takes place in 2005. Basically both on your second question, I would like advice on how to program this and what language would be best suited, although I only have good experience in Java.


  • Registered Users Posts: 5,102 ✭✭✭mathie


    Willem D wrote:
    Thanks for your swift reply Mathie, ok the ten times bit means the persons name goes into the draw ten times. Effectively for arguments sake if I haven't won the prize draw since 1950 my name would be in the prize draw 55 times when the draw takes place in 2005. Basically both on your second question, I would like advice on how to program this and what language would be best suited, although I only have good experience in Java.

    I'm still a little confused.

    Do you want to basically click a button and then be informed of a winner?
    Does every entrant hold a certain amount of tickets? (based on how long since they've won the last draw)

    M


  • Registered Users Posts: 8,676 ✭✭✭Chong


    Spot on, then I want it to be written back to the database.


  • Advertisement
  • Registered Users Posts: 5,102 ✭✭✭mathie


    Willem D wrote:
    Spot on, then I want it to be written back to the database.

    I'd use ASP with VBScript and some Javascript (but then again I usually do).

    I don't imagine there would be much programming to this.

    In your DB have a table RESULTS with userid, date (and if you need anything else) and have a USERDETAILS table with the relevant info userid, firstname, second name etc....

    The scripting will be able to work out the date difference between now and when a user last won and then allocate them a number of tickets.

    Just use some random number generator code to pick a winner.

    M


  • Registered Users Posts: 8,676 ✭✭✭Chong


    Could I do it all with Javascript as I learnt all about that last year at college, I am a little unsure about ASP & VBscript.


  • Registered Users Posts: 5,102 ✭✭✭mathie


    Willem D wrote:
    Could I do it all with Javascript as I learnt all about that last year at college, I am a little unsure about ASP & VBscript.

    You will need to interact with you DB and as far as I know (I may be wrong) you cannot connect to a DB with Javascript.

    Doing it with ASP/VBSCRIPT is quite easy. I'm sure a quick google show you the way.

    M


  • Registered Users Posts: 3,012 ✭✭✭BizzyC


    If you already know Java and Javascript I'd recommend JSP.
    You'll be able to use all the same JDBC stuff as you'd use with Java.


  • Moderators, Science, Health & Environment Moderators Posts: 8,950 Mod ✭✭✭✭mewso


    If you are a Java programmer then Asp.Net with C# would be easy enough (similar syntax) and very easy to integrate with an MsAccess DB.


  • Advertisement
  • Registered Users Posts: 4,003 ✭✭✭rsynnott


    mathie wrote:
    You will need to interact with you DB and as far as I know (I may be wrong) you cannot connect to a DB with Javascript.

    Oh, but you can! It's unspeakably horrible, tho; involves a Java bridge...


  • Registered Users Posts: 32,136 ✭✭✭✭is_that_so


    ASP/VBScript is probably the most straightforward to do. I'd stay away from Java and jsp for such a simple project.

    Very small bits of code for db connection and retrieval with ASP.

    As the man said google for it, especially "recordset" and "response.write".

    Good luck


  • Registered Users Posts: 8,676 ✭✭✭Chong


    All this advice is great lads I am going to give the VbScript an Asp a go , I am going to check out a few tutorials.


  • Moderators, Science, Health & Environment Moderators Posts: 8,950 Mod ✭✭✭✭mewso


    is_that_so wrote:
    ASP/VBScript is probably the most straightforward to do. I'd stay away from Java and jsp for such a simple project.

    Very small bits of code for db connection and retrieval with ASP.

    As the man said google for it, especially "recordset" and "response.write".

    Good luck

    Why are people still suggesting asp/vbscript when it's virtually obsolete and effectively a newer and superior version (asp.net) has existed for quite some time.


  • Closed Accounts Posts: 4,943 ✭✭✭Mutant_Fruit


    I have to say, if you've done any programming, ASP.net and C# is pretty handy (assuming you have someone to ask questions if you can't figure something out).

    I've picked up a fair bit in the last two weeks. I know enough to connect to a database, get any info from it via SQL, bring it to a webpage, use dropdowns to apply filtering and suchlike if needed. All in all, not bad for 2 weeks learning. Fine, my knowledge is a bit sketchy at the moment, but i'm getting there! Give me an example and i can figure out what i should do i my project to achieve the same effect.


  • Registered Users Posts: 32,136 ✭✭✭✭is_that_so


    musician wrote:
    Why are people still suggesting asp/vbscript when it's virtually obsolete and effectively a newer and superior version (asp.net) has existed for quite some time.
    Agreed but ASP is very easy and does the trick here. "Horses for courses" :D


  • Registered Users Posts: 304 ✭✭PhantomBeaker


    If you were using postgresql I could think of some useful bits and pieces that would make a good sql statement that would do most of the grunt work. I'm sure access has similar functions (I'm thinking mainly of the random() function in pgsql that allows you to order a table randomly)

    Basically the idea would be, in pseudo-pseudo-code:
    select the properties you want
    from wherever you want
    order it randomly (using a random function)
    where the date is greater than the start date and is less than the cutoff date (i.e. if you want the draw results for year 95, then the cutoff year is either 95 or 96 depending on how you write your condition)
    limit it to 1 result.

    You can suit this to your tastes.

    Now you could put that as a subquery in an insert statement. That makes the choice of programming language trivial as you now have just a long statement to send to the database, and doing that is generally just a one-liner, especially if they have odbc support. So then you just choose which one you're most comfortable with.


  • Registered Users Posts: 8,676 ✭✭✭Chong


    I am so unsure now what to do I have only experience in Java, Javascript and HTML. Is vb script and asp easy to use, do I need something like microsoft visual studio. Remember this is only a small project, thats why I thought I could do it in Java with JDBC.


  • Registered Users Posts: 32,136 ✭✭✭✭is_that_so


    Willem D wrote:
    I am so unsure now what to do I have only experience in Java, Javascript and HTML. Is vb script and asp easy to use, do I need something like microsoft visual studio. Remember this is only a small project, thats why I thought I could do it in Java with JDBC.

    Catchword here is "simple". I can see why you're confused.

    You are using Access which is fine for your project.
    No need for Postgre,Informix,SQL server, Oracle or My SQl.

    I'd say go with the Java / ODBC if you think you can do it quickly and easily enough or if not use ASP.
    ASP, although old, is simple enough to learn but it will do what you need without huge chunks of code.
    There are also oodles of tutorials and bits of code out there.

    Good luck.


  • Moderators, Science, Health & Environment Moderators Posts: 8,950 Mod ✭✭✭✭mewso


    As I said before if you are from a Java background c# will be a piece of the proverbial. Assuming you are using a Windows machine-

    1. Download and install the .Net Framework 1.1
    2. Download the free Asp.Net Web Matrix development tool (i.e. no you don't need Visual Studio)
    3. Have a read of the tutorials.

    None of this will take very long. You may find it useful.


  • Advertisement
  • Registered Users Posts: 8,676 ✭✭✭Chong


    Thanks again guys. I have spent the day learning asp and vbscript and seems quite easy.


Advertisement