Results 1 to 9 of 9

Thread: [RESOLVED] Which to learn, Access, Sql, etc.

  1. #1

    Thread Starter
    Fanatic Member
    Join Date
    Jul 2006
    Location
    Anchorage, Alaska
    Posts
    545

    Resolved [RESOLVED] Which to learn, Access, Sql, etc.

    I've made a program that opens up "Text Files" and I use them as my Database/Saved information.

    The program is a Video/DVD rental program.

    It keeps track of Customers, Accounts, Actors, DVD's, Fees, etc.

    Right now each movie saved to the text file is about 1.2k (550k total)


    I expect to have 200-700 Accounts with double to tripple the customers.
    I expect to have 700-1500 DVDs total.

    I know little about Access, little about Sql. Nothing about any other Database.

    Some of the information that is stored for Movies is following:

    VB Code:
    1. Type movieinfo
    2.    moviename As String 'example ---Main Hoon Na
    3.    Character1 As String  'example ---Shah Ruk Khan
    4.    Character2 As String  'example ---
    5.    releasedate As String  'example --- 01/01/2004 (sometimes you just know the year)
    6.    RunningTime As Integer 'example --- 180 as mins
    7.    AgeGroup As Byte  'example --- 0=All Audiances,1=adults,2=teens+,3=kids+
    8.    Subtitles As Boolean 'example --- 0 = False, if it was true. -1 = True
    9.    NewMovie As Boolean 'example --- -1 = true , 0=false
    10.    Description As String 'example --- Maj. Ramprasad Sharma(Shah Ruk Khan) is going back to school...
    11.    Type As Byte 'example  --- 0-10 (0=comedy, 1=drama, 2=action/suspence, 3=scary/horror, 4=family,5=Science Fiction)
    12.    quantity As Byte 'example --- 2 in stock
    13.    Avail As Byte 'example --- 1 avil, meaning that 1 is checked out
    14.    movienumber As Integer 'example --- 75, but -75 if it is deleted
    15.    Deleted As Boolean
    16.    RentedNew As Integer
    17.    RentedOld As Long
    18.    AccountsRentedTo As String
    19.    BarCode As String
    20.    PicPath As String 'Hard Drive Path to the Picture to display.
    21.    TotalQInfo As Long
    22.    QInfo() As QuantityInformation
    23. End Type
    24.  
    25. Type QuantityInformation
    26.     CopyLetter As String 'A,B,C,D,E....AA,BB,CC......AAA,BBB....
    27.     Rented As Boolean 'self explanitory
    28.     Account As Long '5 - know who rented it out to.
    29.     PurchaseDate As String '07/16/2006
    30.     PurchaseAmount As Currency '17.99
    31.     SoldDate As String '07/17/2006
    32.     SoldAmount As Currency ' 5.99 (Add in cost of renting it out 17, total from movie 22.99 that is $5 profit)
    33.     SoldTo As Long ' Customer Array Number
    34.     RentedNew As Integer '5   (so 3*5=15)
    35.     RentedOld As Integer '1   (so 2*1=2)
    36.     RentedNewProfit As Currency
    37.     RentedOldProfit As Currency
    38.     LateNew As Integer 'tracks how many times a movie has been returned late as new
    39.     LateOld As Integer 'tracks how many times a movie has been returned late as old
    40.     LateNewProfit As Currency
    41.     LateOldProfit As Currency
    42.     Status As Byte '0=Available/Owned still,  1=Sold, 2=LostByCustomer,3=Damaged, 4=stolen, etc.
    43.     NewWhenRented As Boolean
    44. End Type

    I just copied and pasted my current User Defined Type.

    I am going to first learn about a specific database format/system. Then Re-program my DVD Rental program with it.

    Thank you for your input.
    Last edited by rack; Dec 22nd, 2006 at 02:10 AM.
    Please RATE posts, click the RATE button to the left under the Users Name.

    Once your thread has been answered, Please use the Thread Tools and select RESOLVED so everyone knows your question has been answered.


    "As I look past the light, I see the world I wished tonight, never the less, sleep has come, and death shall soon follow..." © 1998 Jeremy J Swartwood

  2. #2
    Just Married shakti5385's Avatar
    Join Date
    Mar 2006
    Location
    Udaipur,Rajasthan(INDIA)
    Posts
    3,747

    Thumbs up Re: Which to learn, Access, Sql, etc.

    Database is depending on the project on a little level you have to use Access, after SQL server or Oracle. But about Learning I suggest that Learn all but perfect ness is necessary. Increase the knowledge of SQL.

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

    Re: Which to learn, Access, Sql, etc.

    From a VB point of view, there isn't much difference between database systems - it is typically just one line of code (which specifies connection details) that needs to change from one system to another. From the sound of it Access will be fine for you, or you could use SQL Server Express (which is free) for more reliablility.

    I would recommend going thru our ADO Tutorial (link in my signature), as that shows how to do the most common tasks.

    You have a good data structure already, but it can be improved for use in a database. For example, with "AgeGroup" you would add an extra table containing the values & descriptions (0=All Audiances,1=adults,...), and could easily show this on your VB form directly from the database (which means that if one of these descriptions changes, you only need 1 change in the database, rather than several in a program which then needs to be re-compiled).

  4. #4

    Thread Starter
    Fanatic Member
    Join Date
    Jul 2006
    Location
    Anchorage, Alaska
    Posts
    545

    Re: Which to learn, Access, Sql, etc.

    I did the first tutorial, i'll see if there is another one. I created an Access database, or started to. I made a crap load of tables to show relations, I'm not sure if i'm using the tables correctly. I've uploaded and attached the database I started. I have been told (which may be wrong) that if you can design a database (tables relationships etc) it can reduce coding drastically, and even help eliminate problems. If possible, could someone tell me if i'm on the right track with what i've done? Thank you.

    I created a bunch of dependancies and about 20 or so tables.

    Am I linking this information correctly?
    Attached Files Attached Files
    Please RATE posts, click the RATE button to the left under the Users Name.

    Once your thread has been answered, Please use the Thread Tools and select RESOLVED so everyone knows your question has been answered.


    "As I look past the light, I see the world I wished tonight, never the less, sleep has come, and death shall soon follow..." © 1998 Jeremy J Swartwood

  5. #5
    Frenzied Member KGComputers's Avatar
    Join Date
    Dec 2005
    Location
    Cebu, PH
    Posts
    2,024

    Re: Which to learn, Access, Sql, etc.

    Good day!!!


    From my point of view, you have done a great job. Your next step is to check whether your tables are normalized. 3NF/4NF/5NF depending on the needs of the company. Next is to be familiar with the forms/queries/reports needed for the video rental. Then comes the coding part. You may use the visual basic editor for access. ADO can also be used.

    I have designed systems using access alone, but as requirements grow, you need a stable DBMS like Sequel server/MySQL and etc. You may also need VB as the front end.


    Greg
    CodeBank: VB.NET & C#.NET | ASP.NET
    Programming: C# | VB.NET
    Blogs: Personal | Programming
    Projects: GitHub | jsFiddle
    ___________________________________________________________________________________

    Rating someone's post is a way of saying Thanks...

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

    Re: Which to learn, Access, Sql, etc.

    That design looks very good considering your lack of DB experience.. the only comments I have are:

    In "ActorsInMovies" you have a "Priority" field.. the values you have specified in the comments should be in a separate table ("ActorPriorities"?), so they can be used as I described above. The same applies in other places too, such as "Paidwith" in "CheckedOut".

    In your "Invoice.." tables you have "Total" fields.. if this is just a sum of other fields (eg: Price and Shipping) then you dont need to store the total - it can be calculated for you when you get the data from the database (by specifying it in your Select query);This removes the chances of errors when only one of the fields is updated. Various fields in the "Movies" could also be done in a similar (but slightly more complex) way, such as "Available" and "Rentednew" etc (which would be a calculation based on the data in "RentedInfo").

  7. #7

    Thread Starter
    Fanatic Member
    Join Date
    Jul 2006
    Location
    Anchorage, Alaska
    Posts
    545

    Re: Which to learn, Access, Sql, etc.

    That makes sence, repeating data, or saving information that can be calculated seems it could be an issue. Thank you all for your inputs thus far. Some of the fields in the tables I may be removing. But looks like I need to make sure I clean up things that can be seperated into there own tables. Thanks agfain for the input guys.

    After re-revewing my tables, I can see a few other places where I need to move fields from one table to another.

    When I created the database I didn't understand the Relationships much.

    Like in Awardinmovies I have Yearofaward, specifics, extrainfo. I Belive I need to move those into the Award section.

    I honestly can't remember what I created that Priority Variable for. I think maybe to show the lead actors first, etc....


    EDIT:

    Do I need to create a "look up table" for CustomersonAccounts, to link the customers with the accounts table? Or does the account number in the customer table work fine?
    Last edited by rack; Dec 22nd, 2006 at 02:14 AM.
    Please RATE posts, click the RATE button to the left under the Users Name.

    Once your thread has been answered, Please use the Thread Tools and select RESOLVED so everyone knows your question has been answered.


    "As I look past the light, I see the world I wished tonight, never the less, sleep has come, and death shall soon follow..." © 1998 Jeremy J Swartwood

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

    Re: Which to learn, Access, Sql, etc.

    For Award/Awardinmovies, it depends what info you are storing.. I had assumed that the Award would be for general details about the type of award (eg: Film Festival Award for Best Actress/Awarded by the film federation), and that Awardinmovies would be for details of specific 'wins'. If my assumptions are correct, your current design is right.

    The idea of Priority is a good one - I have been searching for movie as an xmas present, and wanted to know if a certain actor was a major part or not (luckily one of the web sites I looked at had that info). I presume the customers would want to know this too.

    The need for CustomersonAccounts depends on the number of accounts a Customer can have.. if each Customer can have multiple accounts, you need it (and remove accountnumber from the customer table). If a customer can only have one account (and each account has only one customer) there isn't actually a need for the account table - the details should be moved into the Customer table.

  9. #9

    Thread Starter
    Fanatic Member
    Join Date
    Jul 2006
    Location
    Anchorage, Alaska
    Posts
    545

    Re: Which to learn, Access, Sql, etc.

    I'm allowing up to 5 customers per account. up to 10 movies rented to an account at a time also.

    Happy holidays to all.

    Thank you again Si_The_Geek.
    Please RATE posts, click the RATE button to the left under the Users Name.

    Once your thread has been answered, Please use the Thread Tools and select RESOLVED so everyone knows your question has been answered.


    "As I look past the light, I see the world I wished tonight, never the less, sleep has come, and death shall soon follow..." © 1998 Jeremy J Swartwood

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