|
-
Jan 11th, 2003, 11:51 AM
#1
Thread Starter
Hyperactive Member
Adodc control question
I'm sure this may seem to be a stupid question but I sure hope I can get an answer.
When the user of my app starts the app, 4 forms must be loaded only one visible.They switch back and forth between the forms but all stay loaded until saved. At present each form has an Adodc control that is setup identical to each of the other forms. So each makes a connection to the SQL db. Is there a way to use just one Adodc control on one form and ref it on the other forms rather than using 4 seperate ones for each form? If so how do I ref it on the other forms controls like txtbox combobox etc in the Data Source property?
-
Jan 11th, 2003, 11:59 AM
#2
Fanatic Member
I doubt you can do that. A control has to be added to every form either through Code or in design window. The best thing to do to make things easier is, change the properties of one control on any form and then use it to assign properties of the other ADODC controls instead of making calculations or other connection codes.
THE TIME/WEATHER IS 
Don't know how to use APIs or have problem with them,
Download API-Guide & API-Viewer from http://www.allapi.net
-
Jan 11th, 2003, 01:21 PM
#3
Thread Starter
Hyperactive Member
Thanks for the response I really appreciate it. below is what I'm doing when the user doubleclicks a datagrid that is the fileNO he is looking for.
VB Code:
frmAdminInfo.Adodc3.RecordSource = "SELECT * FROM tblClaim WHERE FileNo = '" & DataGrid1.Columns(0).Text & "'"
frmVehicleInfo.Adodc3.RecordSource = "SELECT * FROM tblClaim WHERE FileNo = '" & DataGrid1.Columns(0).Text & "'"
frmAppraisal.Adodc3.RecordSource = "SELECT * FROM tblClaim WHERE FileNo = '" & DataGrid1.Columns(0).Text & "'"
frmInvoice.Adodc3.RecordSource = "SELECT * FROM tblClaim WHERE FileNo = '" & DataGrid1.Columns(0).Text & "'"
as you can see each Adodc is making the exact same db connection. When 50 or 60 users are using the app it slows things down considerably that's why I was hoping to find a way to make it faster. Maybe looking at the above code you might help me find a better way to accomplish this.
Thanks again for your help
-
Jan 12th, 2003, 02:45 AM
#4
Fanatic Member
You can try...
VB Code:
frmAdminInfo.Adodc3.RecordSource = "SELECT * FROM tblClaim WHERE FileNo = '" & DataGrid1.Columns(0).Text & "'"
With frmAdminInfo
frmVehicleInfo.Adodc3.RecordSource = .Adodc3.RecordSource
frmAppraisal.Adodc3.RecordSource = .Adodc3.RecordSource
frmInvoice.Adodc3.RecordSource = .Adodc3.RecordSource
End With
Of course, this will give speed improvements only if you are doing many codes before connecting to the RecordSet, like reading for a text file/registry to get the file path, etc...
THE TIME/WEATHER IS 
Don't know how to use APIs or have problem with them,
Download API-Guide & API-Viewer from http://www.allapi.net
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|