Solved

VB6 & ADODC Using SQL

Posted on 1998-10-12
2
1,148 Views
Last Modified: 2013-12-25
Using VB5 Ent., I have written a program using a number of controls (bound & unbound).  I've tried updating to VB6 Ent. using ADODC.  I have a DBCombo bound to a DAO control to load the contents into the list, which works fine with ADODC.  The problem is that I load a DB Grid with a second ADO data control using the bound text from the DBCombo.  When I try to assign the grid using sql on the second control without specifying a recordsource, I get an error stating same.  I can't use sql in the properties of the ADODC because it is reliant on the bound column of the DBCombo.

Any ideas would be great.

   
0
Comment
Question by:nu2vb
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 3

Accepted Solution

by:
TheAnswerMan earned 50 total points
ID: 1496847
What I usually do is Assign a SQL Statement that will return no rows.  IE "SELECT CompanyNumber From CompanyList WHERE CompanyNumber = "XXXX"
Then. the grid will be empty.
When the User Clicks on an Item in the Combo.. the Recordsource is
Select * from CompanyList WHERE CompanyNumber ='" & cboList & "'"

I also use this technique when I know the recordset is quite large, and I dont want the user to wait for it to load, just so they can select another one from the list.
0
 

Author Comment

by:nu2vb
ID: 1496848
Excellent!  
Something so simple and it works - Thanks for pointing it out.  I will also use it like you said - With large recordsets!

Thanks again.........
0

Featured Post

Online Training Solution

Drastically shorten your training time with WalkMe's advanced online training solution that Guides your trainees to action. Forget about retraining and skyrocket knowledge retention rates.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

The debugging module of the VB 6 IDE can be accessed by way of the Debug menu item. That menu item can normally be found in the IDE's main menu line as shown in this picture.   There is also a companion Debug Toolbar that looks like the followin…
If you need to start windows update installation remotely or as a scheduled task you will find this very helpful.
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…
Suggested Courses
Course of the Month11 days, 12 hours left to enroll

623 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question