Results 1 to 22 of 22

Thread: University Project someone please help!

  1. #1

    Thread Starter
    New Member
    Join Date
    Feb 2007
    Posts
    12

    University Project someone please help!

    I have got to do this program prototype for university using VB6. There are a few things that are giving me headaches and would really appreciate if someone can help me out with some code. i dont know if i can send the program to someone thru msn or something so they can have a look at it and give me some help?

    First problem is getting a registered user's username and balance to appear on each screen, i know it has something to do with public variables using modules or something but dont know.

    Any help much appreciated.
    Attached Files Attached Files
    Last edited by kort1st; Feb 16th, 2007 at 07:05 PM.

  2. #2

  3. #3

    Thread Starter
    New Member
    Join Date
    Feb 2007
    Posts
    12

    Re: University Project someone please help!

    thanx for ur reply.. could you pls tell me how i would show u what ive got so far as im just new to this

  4. #4
    Former Admin/Moderator MartinLiss's Avatar
    Join Date
    Sep 1999
    Location
    San Jose, CA
    Posts
    33,431

    Re: University Project someone please help!

    Either copy/paste your code into a post or put all your project files into a zip file and attach it to a post via the Manage Attachments button that shows up in the frame below the one where you create a post. BTW if you copy/paste then you can make your code easier to read if you surround the code with VBCode tags as in this example.

    [vbcode]
    'Your code
    [/vbcode]

    which will cause it to show up like this.
    VB Code:
    1. ' Your code

  5. #5

    Thread Starter
    New Member
    Join Date
    Feb 2007
    Posts
    12

    Re: University Project someone please help!

    there u r ive attached the project, zipped with winrar

  6. #6
    Former Admin/Moderator MartinLiss's Avatar
    Join Date
    Sep 1999
    Location
    San Jose, CA
    Posts
    33,431

    Re: University Project someone please help!

    After Browsing for your rar, did you click Upload because there's no attachment in your post. BTW, more people have winzip (or XP which has Send To->Zip option) than rar, so if you can that's the way to go.

  7. #7

    Thread Starter
    New Member
    Join Date
    Feb 2007
    Posts
    12

    Re: University Project someone please help!

    ok dun using winzip (attached to first post)

  8. #8

  9. #9
    Lively Member
    Join Date
    Nov 2006
    Location
    San Pedro, CA
    Posts
    104

    Re: University Project someone please help!

    There are a multitude of naming problems in that project...

    I really don't know where to start, but if I had the time, it would almost be faster for me to re-write this thing than show you how.

    **** EDIT ****

    I took another 2 minutes to look at it... this is quite far from being ready, you do know that.

    The ADO has barely been set up... there are object issues all over the place...

    I almost get the feeling you want someone here to re-write it for you.
    Last edited by realbogus; Feb 16th, 2007 at 07:33 PM.

  10. #10

    Thread Starter
    New Member
    Join Date
    Feb 2007
    Posts
    12

    Re: University Project someone please help!

    there are a good few things i dont know how to do, @ realbogus the project runs fine on the college computer but wen i try to run it on my comp it has an error in linkin with access for some reason...martin the first thing that i would like to do is when u clic on proceed on the existing users screen i would like the username and balance to show on the tune page next i would like that wenever a user clics on a radio button, the result of that shows in the text box i.e on the first page of the questionaire its asks "first time using belltunes?" and the user could clic yes or no and the text yes or no would appear in the text box. I know this would seem very easy to u guys but im in my first year and is proving very difficult for me.

  11. #11

    Thread Starter
    New Member
    Join Date
    Feb 2007
    Posts
    12

    Re: University Project someone please help!

    realbogus i dont want someone to rewrite it for me, the project is fine its been checked by a college lecturer i am on the right lines, its a very simple program just to show that the code we have learned so far in the past 10 weeks.

  12. #12
    Lively Member
    Join Date
    Nov 2006
    Location
    San Pedro, CA
    Posts
    104

    Re: University Project someone please help!

    I wonder what your ODBC driver looks like on your home PC versus your school computer.

    Using ADO removes some of the issues of accessing Access db's, versus, using old school DAO.

  13. #13
    Lively Member
    Join Date
    Nov 2006
    Location
    San Pedro, CA
    Posts
    104

    Re: University Project someone please help!

    Quote Originally Posted by kort1st
    realbogus i dont want someone to rewrite it for me, the project is fine its been checked by a college lecturer i am on the right lines, its a very simple program just to show that the code we have learned so far in the past 10 weeks.
    when I loaded it, I was getting naming conventions issues... all the form names were freaking out.

    it just looked very strange...

  14. #14

    Thread Starter
    New Member
    Join Date
    Feb 2007
    Posts
    12

    Re: University Project someone please help!

    also i need to make the users that sign up they get added to the database and when a user purchases a tune the balance reduces accordingly. the project isnt linked to any mp3s by the way remember its just a simple prototype

  15. #15

    Thread Starter
    New Member
    Join Date
    Feb 2007
    Posts
    12

    Re: University Project someone please help!

    the naming issues isnt a real problem for now im sure that can be quite easily sorted.

  16. #16

    Thread Starter
    New Member
    Join Date
    Feb 2007
    Posts
    12

    Re: University Project someone please help!

    can anyone help in any way?

  17. #17
    Learning .Net danasegarane's Avatar
    Join Date
    Aug 2004
    Location
    VBForums
    Posts
    5,853

    Re: University Project someone please help!

    Change the Provider string as given and run the project
    VB Code:
    1. Provider=Microsoft.Jet.OLEDB.4.0;Data Source=Bands.mdb;Persist Security Info=False
    Please mark you thread resolved using the Thread Tools as shown

  18. #18

    Thread Starter
    New Member
    Join Date
    Feb 2007
    Posts
    12

    Re: University Project someone please help!

    the provider string is already set at that

  19. #19

    Thread Starter
    New Member
    Join Date
    Feb 2007
    Posts
    12

    Re: University Project someone please help!

    how then would i be able to get that when a new user signs up they are automatically added to the database?

  20. #20
    Learning .Net danasegarane's Avatar
    Join Date
    Aug 2004
    Location
    VBForums
    Posts
    5,853

    Re: University Project someone please help!

    VB Code:
    1. Private Sub cmdcreate_Click()
    2.    
    3.  
    4. '***** Declaration of Variables *****
    5.  
    6. Dim strFirst As String          'Declaration of first name
    7. Dim strLast As String           'Declaration of last name
    8. Dim strBalance As String        'Declaration of balance
    9. Dim strDiff  As String          'Declaration of difference
    10. Dim strUser As String           'Declaration of Username
    11.  
    12. '***** End of Variable Declaration *****
    13.  
    14. '***** Input *****
    15.  
    16. strFirst = txtFrst.Text         'First name input
    17. strLast = txtLst.Text           'Last name input
    18. strBal = txtBal.Text             'Balance input
    19.  
    20. '***** End of Input *****
    21. [B]'**** ADD to database
    22. Dim con As New ADODB.Connection
    23. Dim rs As New ADODB.Recordset
    24. con.Open "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=Bands.mdb;Persist Security Info=False"
    25. If con.State = 0 Then MsgBox "Error in opening Database": Exit Sub 'exit
    26. rs.Open "select * from Users where Username='" & Trim(txtUser.Text) & "'", con, adOpenDynamic, adLockOptimistic 'Search for the previously added entry
    27. 'If Found then exist
    28. If rs.EOF = False Then 'user exist
    29.     MsgBox "User name ALready Exist", vbInformation
    30.     Exit Sub
    31. Else 'if not found then add new
    32.      rs.AddNew
    33.      rs("First Name") = txtFrst.Text
    34.      rs("Surname") = txtLst.Text
    35.      rs("Balance") = txtBal.Text
    36.      rs("Username") = txtUser.Text
    37.      rs.Update
    38.      MsgBox "User Named added succesfully", vbInformation
    39.      Exit Sub
    40. End If
    41.  
    42. [/B]
    43.  
    44.  
    45.  
    46. '*********************
    47.  
    48.  
    49.  
    50. '***** Processing *****
    51.  
    52. strFN = Left(strFirst, 3)                     'First 3 letters of first name
    53. strSur = Left(strLast, 2)                       'First 2 letters of last name
    54. strDiff = Len(strLast) - Len(strFirst)      'Difference in letters between first and last name
    55. strDiff = Abs(strDiff)                           'Number
    56. strUser = strFN & strDiff & strSur   'Putting them all together                     '
    57.  
    58. '***** End of Processing *****
    59.  
    60. '***** Output *****
    61.  
    62. txtUser.Text = strUser          'Output username
    63. txtBal.Text = strBalance        'Output balance
    64.  
    65. '***** End of Output *****
    66.  
    67. End Sub
    Last edited by danasegarane; Feb 17th, 2007 at 08:01 AM.
    Please mark you thread resolved using the Thread Tools as shown

  21. #21

    Thread Starter
    New Member
    Join Date
    Feb 2007
    Posts
    12

    Re: University Project someone please help!

    thanx for that its just that wen i try this it only adds the first name, surname and balance and not the "username" and doesnt output the created username to the text box on the screen... would i need to link the adodc access database to the screen?

  22. #22
    PowerPoster
    Join Date
    Nov 2002
    Location
    Manila
    Posts
    7,629

    Re: University Project someone please help!

    Add to the database after updating all relevant variables or text fields. So do '**** ADD to database section after '***** End of Output *****

    And I suggest you design your tables with primary keys.

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