Results 1 to 4 of 4

Thread: Adodc control question

  1. #1

    Thread Starter
    Hyperactive Member
    Join Date
    Apr 2002
    Location
    Georgia
    Posts
    337

    Question 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?

  2. #2
    Fanatic Member 007shahid's Avatar
    Join Date
    Feb 2001
    Posts
    562
    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

  3. #3

    Thread Starter
    Hyperactive Member
    Join Date
    Apr 2002
    Location
    Georgia
    Posts
    337
    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:
    1. frmAdminInfo.Adodc3.RecordSource = "SELECT * FROM tblClaim WHERE FileNo =  '" & DataGrid1.Columns(0).Text & "'"
    2.   frmVehicleInfo.Adodc3.RecordSource = "SELECT * FROM tblClaim WHERE FileNo =  '" & DataGrid1.Columns(0).Text & "'"
    3.   frmAppraisal.Adodc3.RecordSource = "SELECT * FROM tblClaim WHERE FileNo =  '" & DataGrid1.Columns(0).Text & "'"
    4.   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

  4. #4
    Fanatic Member 007shahid's Avatar
    Join Date
    Feb 2001
    Posts
    562
    You can try...
    VB Code:
    1. frmAdminInfo.Adodc3.RecordSource = "SELECT * FROM tblClaim WHERE FileNo =  '" & DataGrid1.Columns(0).Text & "'"
    2. With frmAdminInfo
    3.     frmVehicleInfo.Adodc3.RecordSource = .Adodc3.RecordSource
    4.     frmAppraisal.Adodc3.RecordSource = .Adodc3.RecordSource
    5.     frmInvoice.Adodc3.RecordSource = .Adodc3.RecordSource
    6. 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
  •  



Click Here to Expand Forum to Full Width