Link to home
Start Free TrialLog in
Avatar of Karen-Ann
Karen-Ann

asked on

Need serious help with data conection problem

I a currently writing a program for my final year project and have hit a number of major stumbling blocks.

the first problem is that I have 6 combo boxes with different names propagating (adding items) from the same database table. When I select a name from one combo box and then try to select a name from a different box the program throughs an error that is not reconised by the MSDN help files.

What I am trying to do is using curtin criteria add the aproprate names to each of the 6 boxes, it dose this ok. then the useser should be able to select a name from each combo box and click a button to store them to a seperate database table. At present I can not select from one box before it throws an error.

Dose anyone have any ideas what is wrong and how to fix it. I can send you the code if you wish to try.


==========  EXTRA bit ===========

By the way there are more points on offer(aprox:1000 or more) if someone out there can help me get the whole program working properly before the deadline of the 15th of may. A full explenation of the program will be given and a list of the final few bugs that need sorted.  Incase any of you are wondering I am not cut out to be a programmer but will fail my degree if I dont get this working and I have worked so hard over the last few years to get betten by something I have never been taught about. non of my lectures can help so this is my last hope.
 
if you are interested in helping with the extra bit please leave me a message with a contact for you and the line "I am willing to help".  
I know this is cheeky but I am so desperate and  and thing is a try.

=================================================

Avatar of jmgs082598
jmgs082598

Could you pls put the CODE, in order to check it.
There are two different approaches to reading and writing information to the database.  One is the "bound" approach, and another is the "unbound" approach.

Most people start out trying to use Data Controls and the Bound approach.  This is fine, as it requires miminal coding, but often it can cause strange problems.  My preference is for the "unbound" approach, but this requires a lot more code.

My guess is that you are using a data control (if so, are you using an ADODC data control or a DAO data control?)

And, you are setting the DataSource  property of a list or combo box to the name of the data control, and the DataField property of the combo or list to the field name which is the source of the list.

The problem is if you are trying to set several combo boxes/list boxes on the form to the same datafield, the data control is going to get very confused about which combo/list to use when updating the data in the data control (because bound controls automatically update the DB when you move from one record to the next).

Instead of using standard listboxes or combo boxes, you need to use the Microsoft DataBound List control.  You would use this in combination with two data controls on your form.  One data control would be set to the table and field that you want to use to populate the lists.  The other data control would be set to the table and columns that you want to update.

Then, in the Databound List Control you can set different DataSources/DataFields for the List, and "bind" the control to update another datasource/datafield.  To set the proper values, click on the property called DataBindings in the DataBound list's property box.
Send me your project to n_narayanan@yahoo.com

I will modify and send it to you.

Cheers

Narayanan.
ASKER CERTIFIED SOLUTION
Avatar of n_narayanan
n_narayanan
Flag of India image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial