Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

DBGrid binding to a database

DBGrid binding to a database

DBGrid binding to a database

My select statement to generate the DBGrid in VB6 contains a join from the data table to the reference table so descriptive text is displayed instead of a code number. When I change the text entry (via a dropdown from the appropriate column - button property set to true) the reference table is updated as well as the data table. Does anyone know how I can stop updates to the reference table?
Replies continue below

Recommended for you

RE: DBGrid binding to a database

Use the allowupdate property to false

RE: DBGrid binding to a database

I need to clarify with an example ...
Reference table structure is (RefID int,RefDS varchar(50)), Data table structure is (DocID int,RefID int,DocDS varchar(50)). Reference table contains :
1 Fruit
2 Vegetable
3 Animal
Data table contains :
1 1 The life and times of a tomato
2 1 The grapes of wrath
3 3 A man called horse
Datagrid select statement :
select d.docid,d.refid,r.refds,d.docds from data d,reference r where d.refid=r.refid
Datagrid properties :
columns 0 and 1 are not visible
column 2 has button property set to true
What happens :
For DocID=1, I click on the refds button to get a drop down of valid RefDS values. I select Vegetable. Reference is updated correctly, changing RefID from 1 to 2 for DocID 1. However RefDS in the Reference table for RefID 1 is updated to Vegetable!
I can't use allowupdate=false because this is a grid-wide setting which I don't want. I'd also like to avoid using multiple grids if possible.

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Tek-Tips Forums free from inappropriate posts.
The Tek-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members! Already a Member? Login

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close