Visual Basic Code , VB.NET Code, VB Code
  Home   :  Code   :  Forums   :  Submit   :  Mailing List   :  About   :  Contact


Help With Database Programming


Help With Database Programming

Author
Message
dryan
dryan
Forum God
Forum God (1.8K reputation)Forum God (1.8K reputation)Forum God (1.8K reputation)Forum God (1.8K reputation)Forum God (1.8K reputation)Forum God (1.8K reputation)Forum God (1.8K reputation)Forum God (1.8K reputation)Forum God (1.8K reputation)

Group: Forum Members
Posts: 5, Visits: 8
Hello to all. My name is ryan and to get to the point, I'm a graduating student at a certain computer school here in the Philippines. For our final project, my instructor has instructed us to make a system. Now, i've already took this subject twice, having failed last time due to database error and now that it's my 2nd time taking up this subject. I would very much appreciate it if any of you could kindly help me out on how to make the database work.



Here are my specs :

Visual Basic Enterprise Edition

MS Office 2007 - I use the MS Access as database

Windows XP SP2



Anyway, the system is all about Dental System. I've already tried and tried and yet failed again to make the database work. I have no problem with designing and coding a few of the command buttons in the dental system. I'm still a beginner with programming so please bear with me.



Here's the problem, the system is all set in terms of design, now whenever i would try to make a database i do it this way;

1. Add - ins --> Visual Data Manager

2. VisData --> New --> Microsoft Access 7.0 MDB



When i get to this part and start designing the table;

1. Should I include all of the fields that i want to be recorded in the database?

2. Should I also include those that are combo boxes?

3. This system that I am making has a search function, can anyone please tell me how to make that work?

4. Where do I go from now?



Basically, I'm asking help for a step by step procedure on how to make the Database work.



My other problem, whenever I'm finished with the table structure and would start to connect it to the system and begin to add the coding for the SAVE Button

I would use



Data1.Recordset.MoveLast

Data1.Recordset.AddNew

txt1.SetFocus



that's my coding for the SAVE button but it doesn't seem to work cause whenever I would

try save a current record through the system an Error Message would pop up that says

Run Time Error ' 3021 '

" No Current Record " Then you have the option to Continue(grayed out) End Debug Help



Please.. Help me out here. I don't want to fail again on this subject. Please do help me.



Please kindly send me a step by step procedure on how to make the database work.

I don't care if I would have to start from the beginning and ruin the whole design of the system as long as the database can work.

I'm desperate right now. I hope that there's someone out there that can help me out T__T



here's my email address

lil_droj_666@yahoo.com

please please please. help me

vb5prgrmr
vb5prgrmr
Forum God
Forum God (39K reputation)Forum God (39K reputation)Forum God (39K reputation)Forum God (39K reputation)Forum God (39K reputation)Forum God (39K reputation)Forum God (39K reputation)Forum God (39K reputation)Forum God (39K reputation)

Group: Forum Members
Posts: 167, Visits: 786
Okay, several ways in which to get this done...

First, design your database through the access application interface. Now, you said you have 2k7 right? Well then save the database in a previous format, 2000 or 97 if you can, and give it a different file name so you can eventually go back to the 2k7 format.

Next, start a new standard exe project and goto VB's IDE Menu>Add-Ins>Add-In Manager.

When the dialog pops up, scroll down to the VB 6 Data Form Wizard.

Select it/highlight it.

In lower right corner in the frame that has the caption of Load Behavior put a check in the checkbox with the caption of Loaded/Unloaded.

Click OK

Add-Ins>Data Form Wizard

Next (no profile)>Make sure Access is highlighted,Next>Browse for database,Next>(if you get error of unrecognized format error, you need to save the database to a prior version (97))

Now, you should be at a form that asks for a form name. I would suggest that you make the form name descriptive of what kind of example it will generate for you. Presently the form is set up for something like formSingleControl but you can change this (and will need to change this) to say formSingleCode but at this point my suggestion is to run this wizard all fifteen times to take advantage of every example it can give you. Next>

Now, the next form is where you select your record source so select a table or query that you want to use and for now, if you want, just add all the fields. Then if you want, select the field to be sorted by (leave this blank if you want or select the unique id (autonumber) field.). Next>

If you need to, click on the Select All button. Next>

For now, don't save a profile. Finish

Study the code, step through the code, learn the code, absorb the knowledge and let it become one with you... :-)

Good Luck

dryan
dryan
Forum God
Forum God (1.8K reputation)Forum God (1.8K reputation)Forum God (1.8K reputation)Forum God (1.8K reputation)Forum God (1.8K reputation)Forum God (1.8K reputation)Forum God (1.8K reputation)Forum God (1.8K reputation)Forum God (1.8K reputation)

Group: Forum Members
Posts: 5, Visits: 8
thank you so much for the help sir ^^

dryan
dryan
Forum God
Forum God (1.8K reputation)Forum God (1.8K reputation)Forum God (1.8K reputation)Forum God (1.8K reputation)Forum God (1.8K reputation)Forum God (1.8K reputation)Forum God (1.8K reputation)Forum God (1.8K reputation)Forum God (1.8K reputation)

Group: Forum Members
Posts: 5, Visits: 8
hello to everyone. lately i was able to create the database for the dental system

that i was making and was able to make it work but recently i made a few changes with the form

of the system and these changes are;

instead of text box I used combo boxes with the selection of yes and no.

my question is;

what kind of field type should i use in the table?

should i use text, boolean, integer?

and my other problem is that everytime i tried to save a sample record on the system i would

receive an error message that says

"run time error 3426"

" this action was cancelled by an associated object"

and i get the option

continue

end

debug

help

what i do is i select on debug and then it would of course stop the system and would

highlight the coding with the error.

the error is on the coding for my save button. can somebody please tell me the correct

coding for the save button.

my system has 3 major command buttons and these are:

SAVE

Data1.recordset.movelast

Data1.recordset.addnew

Data1.recordset.update



UPDATE

Data1.recordset.edit

Data1.recordset.update



NEW PATIENT

Data1.recordset.movelast

Data1.recordset.addnew

txtname.setfocus



can somebody tell me why am I receiving that error message?

please do help me T__T
vb5prgrmr
vb5prgrmr
Forum God
Forum God (39K reputation)Forum God (39K reputation)Forum God (39K reputation)Forum God (39K reputation)Forum God (39K reputation)Forum God (39K reputation)Forum God (39K reputation)Forum God (39K reputation)Forum God (39K reputation)

Group: Forum Members
Posts: 167, Visits: 786
Okay, its been awhile since I used the data control but if I remember correctly... if your textboxes are bound to the control and you invoke the move last argument the data in the textboxes changes (thus erasing any entered information or editing the record you were previously on). So when this happens and then you say addnew/update you are either trying to enter a duplicate record or a blank record and your database is telling you no for some reason. Maybe because of the rules of the database that you have set up (field cannot be blank or cannot be duplicated.). Another reason is maybe you have this data control based upon two tables that are related via a parent/child relationship. You cannot update it this way as you must first enter the parent record, retrieve its unique ID (if you have one) and then use that ID as the foreign key in the child table.

 

 

 

Good Luck

KSTyagiG
KSTyagiG
Forum God
Forum God (343 reputation)Forum God (343 reputation)Forum God (343 reputation)Forum God (343 reputation)Forum God (343 reputation)Forum God (343 reputation)Forum God (343 reputation)Forum God (343 reputation)Forum God (343 reputation)

Group: Forum Members
Posts: 1, Visits: 5
Thanks for the information.

http://www.sagarinfotech.com/DatabaseDesign.aspx

Sumit Tyagi

webmasterdenavi
webmasterdenavi
Forum God
Forum God (365 reputation)Forum God (365 reputation)Forum God (365 reputation)Forum God (365 reputation)Forum God (365 reputation)Forum God (365 reputation)Forum God (365 reputation)Forum God (365 reputation)Forum God (365 reputation)

Group: Forum Members
Posts: 1, Visits: 1
thank you so much for the help.. this post clear my all doubts.





gps navi garmin spezial gps navi Deutschland | spezial gps navis Outdoor gps navi Deutschland | tragbare GPS-Navi Deutschland Online gps navi
GO


Similar Topics


Reading This Topic


Login
Existing Account
Email Address:


Password:


Social Logins

Select a Forum....

















A1VBCode Forums


Search