1 Attachment(s)
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.
Re: University Project someone please help!
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
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.
Re: University Project someone please help!
there u r ive attached the project, zipped with winrar
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.
Re: University Project someone please help!
ok dun using winzip (attached to first post)
Re: University Project someone please help!
Please describe step by step exactly how to get to the problem.
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.
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.
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.
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.
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...
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
Re: University Project someone please help!
the naming issues isnt a real problem for now im sure that can be quite easily sorted.
Re: University Project someone please help!
can anyone help in any way?
Re: University Project someone please help!
Change the Provider string as given and run the project
VB Code:
Provider=Microsoft.Jet.OLEDB.4.0;Data Source=Bands.mdb;Persist Security Info=False
Re: University Project someone please help!
the provider string is already set at that
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?
Re: University Project someone please help!
VB Code:
Private Sub cmdcreate_Click()
'***** Declaration of Variables *****
Dim strFirst As String 'Declaration of first name
Dim strLast As String 'Declaration of last name
Dim strBalance As String 'Declaration of balance
Dim strDiff As String 'Declaration of difference
Dim strUser As String 'Declaration of Username
'***** End of Variable Declaration *****
'***** Input *****
strFirst = txtFrst.Text 'First name input
strLast = txtLst.Text 'Last name input
strBal = txtBal.Text 'Balance input
'***** End of Input *****
[B]'**** ADD to database
Dim con As New ADODB.Connection
Dim rs As New ADODB.Recordset
con.Open "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=Bands.mdb;Persist Security Info=False"
If con.State = 0 Then MsgBox "Error in opening Database": Exit Sub 'exit
rs.Open "select * from Users where Username='" & Trim(txtUser.Text) & "'", con, adOpenDynamic, adLockOptimistic 'Search for the previously added entry
'If Found then exist
If rs.EOF = False Then 'user exist
MsgBox "User name ALready Exist", vbInformation
Exit Sub
Else 'if not found then add new
rs.AddNew
rs("First Name") = txtFrst.Text
rs("Surname") = txtLst.Text
rs("Balance") = txtBal.Text
rs("Username") = txtUser.Text
rs.Update
MsgBox "User Named added succesfully", vbInformation
Exit Sub
End If
[/B]
'*********************
'***** Processing *****
strFN = Left(strFirst, 3) 'First 3 letters of first name
strSur = Left(strLast, 2) 'First 2 letters of last name
strDiff = Len(strLast) - Len(strFirst) 'Difference in letters between first and last name
strDiff = Abs(strDiff) 'Number
strUser = strFN & strDiff & strSur 'Putting them all together '
'***** End of Processing *****
'***** Output *****
txtUser.Text = strUser 'Output username
txtBal.Text = strBalance 'Output balance
'***** End of Output *****
End Sub
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?
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.