Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

One form, three ADO data sources and three grids

Status
Not open for further replies.

Vcscwi

Programmer
Jan 15, 2004
57
US
I'm sure this will be obvious to most of you...

I have a form which I think I need three ADO Data controls. One for tblInvoices, tblReceipts and tblVoids.

On the screen the user enters a invoice number and the three grids are to then show any data they may have for that invoice number. The table structures are different enough that I don't want to combine them into one SQL Select statement.

When I try to run the screen I get an error. "Method or data member not found" I get it on the Load() adoInvoiceHistory.Mode = adModeRead


Private Sub Form_Load()
cnInvoice.Open "Provider=Microsoft.Jet.OLEDB.4.0; Data Source = " & thePath
adoInvoiceHistory.Mode = adModeRead
adoInvoiceHistory.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0; Data Source = " & thePath


I guess my question is: Is this because I have 3 ADO connections? I am confusing the form?

Any insight on this would be great!

Thanks.
 
I have a form with more than 3 ADODC controls. That is no problem.

I would put the connection before the mode:
adoInvoiceHistory.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0; Data Source = " & thePath

adoInvoiceHistory.Mode = adModeRead

And adModeReadWrite rather than adModeRead if you want the table updated.

Hope that helps.

Eman_2005
Technical Communicator
 
I switched the code around and still get the same message.

Compile error:
Method or Data member not found.

Now it stops on .ConnectionString instead of .Mode.

Any other suggestions?
 
Right click on your adoInvoiceHistory control and click on Properties; in the General tab, make sure you select:
Use Connection String

Eman_2005
Technical Communicator
 
Have you ever used Infragistics Data Widgets?
This original screen worked great. It had a ADODC link and one grid. As soon as I added the second ADODC links I started getting the "Method or data memeber not found error
 
sorry. This is my first VB project and I'm editing someone else's code... still learning. Thanks for your suggestions.
 
This may or may not help, but I recently did a similar task, but used a single ADO object instead. After making a connection, I issued an SQL command to create a view pulling the needed data from multiple tables, then simply grabbed the data from the view I just made, and when done populating the grids just dropped the view from the DB. I imagine a stored procedure would work the same way, but without the need to create/drop an object in the DB.

________
Remember, you're unique... just like everyone else.
 
I should also add, this was done connecting to a SQL server using a DSN provider, not the Jet.OLE provider you are using.

________
Remember, you're unique... just like everyone else.
 
I realize that may not apply to a lot of you, but with the Infragistics grid... my problem was I copied and pasted the grid object which automatically populated the index property with a numeric value. After I cleared that value out the ADO connection was able to find my grid and the data appeared.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top