By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,982 Members | 1,939 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,982 IT Pros & Developers. It's quick & easy.

adodc1 problems

P: 556
im trying to connect a datagrid on a form that has two controls (adodc1 and adodc2) on it one is for the lessor table and the other is for the lease table. i tried to use an sql statement for the lease one but i have no clue what i'm doing im useing vb6 and i have a database from access (2000) where all of this is getting it's information my access database has these fields:

(in lessor table)

Expand|Select|Wrap|Line Numbers
  1. lessorID = autonumber
  2. lessor name = text
  3. address= text
  4. city = text
  5. state = text
  6. zip = text
  7. phone = text
this one is run off of adodc1

the other table i have is the lease table it has this

Expand|Select|Wrap|Line Numbers
  1. leaseID = autonumber
  2. lessorID = number
  3. rentamount= currency
  4. leaseterm=text
  5. from = date/time
  6. to = date/time
this is run off adodc2 (for the datagrid)

i have put these on one form in visual basic 6.0 i want to have the datagrid have only the information that's in the adodc1(lessors table) so when i scroll throught the lessors table the datagrid will only show there information only. pleae help me understand this

Jan 2 '08 #1
Share this Question
Share on Google+
6 Replies

P: 274
Hi Lee,
I think if you will tell little more about your problem it will help us understand little more such as: what the issue is? and what you are looking for ?
Kind Regards
Jan 2 '08 #2

P: 556
Well creative1,

It's like this the problem is how can i use the "id's" from the database to connect the two adodc's
so when i add a new lessor the datagrid will update with that lessor's info. you know this is all on one form or do i have to have another form? i guess what im am looking for is to update the datagrid to retrieve the information from adodc1 only in sql or by other means if it's possible and where i can stick the code to do it, in the form or in the datagrid, or in a modual , a button where? do i dim things or what this datagrid and adodc's are tricky if you don't know anything about them. ms access is not that hard.

Jan 2 '08 #3

Expert 5K+
P: 8,127
instead of using adodc use ADO code and use combobox or listbox . and passthe value for the grid from the control dynamically.
Jan 2 '08 #4

P: 556
hey debasisdas,

can you give me an example code of this so i can understand what you mean?

Jan 4 '08 #5

Expert 5K+
P: 8,127 the ado library from project --> reference. the conection. the 1st recordset.
4.fill the first listbox from this recordset.
5.on the selection of the listbox open another recordset.
6.fill the 2nd lisbox from second recordset.
7.on the selection of the 2nd listbox open 3rd recordset .
8.from this recordset populate the grid control.
Jan 4 '08 #6

P: 866
Hi Lee123

This may help you also, click

These are the basic SQL Syntax for Access Queries

Rey Sean
Jan 4 '08 #7

Post your reply

Sign in to post your reply or Sign up for a free account.