Solved

Slow response using ADOX Catalog over thin client.

Posted on 2004-08-10
6
515 Views
Last Modified: 2013-11-27
Hi since migrating my application from dao to ADO I am experiencing slow repsonses accessing the catalog object. In DAO I used query definations.

The reason I am using the catalog is to access quieries in an access 2000 database. There are probably about 100 queries most of which have parameters.

The main delay seems to be with the opening of the catalog. I know I could change this so that the catalog is opened at the begining of the application but what would happen if some one crashed out.

Also one of the other problems I am having is that I have to put a delay into the program otherwise no data is returned.

    Dim conn As ADODB.Connection
    ConnectToDB conn
    Set cat = New ADOX.Catalog
    'set the catalog the current connection
    cat.ActiveConnection = conn
    'set the command to the query name
    Set cmd = cat.Procedures("dp_Appoints_Qry").Command   'Killer SQL that has UNION...

    'give the parameters
    cmd.Parameters("AP CODE") = (Entity.code)
    Wait 0.2
    Set ApptRS = New ADODB.Recordset
    ApptRS.Open cmd

Thanks MrPan
0
Comment
Question by:MrPan
  • 4
  • 2
6 Comments
 
LVL 142

Expert Comment

by:Guy Hengel [angelIII / a3]
Comment Utility
Why do you pass over the ADOX ?
ADODB Command has a Parameters.Refresh function

Dim conn As ADODB.Connection
    ConnectToDB conn
    'set the command to the query name
    Set cmd = new ADODB.Command
    cmd.command = "dp_Appoints_Qry"
    cmd.parameters.refresh
    'give the parameters
    cmd.Parameters("AP CODE") = (Entity.code)
    Wait 0.2
    Set ApptRS = New ADODB.Recordset
    ApptRS.Open cmd

Please report if this works for your...

CHeers
0
 
LVL 2

Author Comment

by:MrPan
Comment Utility
Angel

Thanks for the quick reply.

cmd.command is not acceptable. I have tried changing this to commandtext but the parameters do not get loaded.

Any suggestions

0
 
LVL 142

Accepted Solution

by:
Guy Hengel [angelIII / a3] earned 500 total points
Comment Utility
Sorry for the typo.

Also, I forgot to connect the command with the connection object...

Dim conn As ADODB.Connection
    ConnectToDB conn
    'set the command to the query name
    Set cmd = new ADODB.Command
    cmd.commandtext = "dp_Appoints_Qry"
    set cmd.activeconnection = conn
    cmd.parameters.refresh
    'give the parameters
    cmd.Parameters("AP CODE") = (Entity.code)
    Wait 0.2
    Set ApptRS = New ADODB.Recordset
    ApptRS.Open cmd

Cheers
0
Enabling OSINT in Activity Based Intelligence

Activity based intelligence (ABI) requires access to all available sources of data. Recorded Future allows analysts to observe structured data on the open, deep, and dark web.

 
LVL 2

Author Comment

by:MrPan
Comment Utility
OK

I have now got it working by adding

cmd.activeconenction = conn

and

cmd.commandtext = "Select * From dp_Appoints_Qry"

I will have to change the code in a few places to see if it is any quicker. I will let you know what I find out.
0
 
LVL 2

Author Comment

by:MrPan
Comment Utility
Found it at the same time. Great minds.....
0
 
LVL 2

Author Comment

by:MrPan
Comment Utility
Many Thanks

Mr Pan
0

Featured Post

Get up to 2TB FREE CLOUD per backup license!

An exclusive Black Friday offer just for Expert Exchange audience! Buy any of our top-rated backup solutions & get up to 2TB free cloud per system! Perform local & cloud backup in the same step, and restore instantly—anytime, anywhere. Grab this deal now before it disappears!

Join & Write a Comment

In a multiple monitor setup, if you don't want to use AutoCenter to position your popup forms, you have a problem: where will they appear?  Sometimes you may have an additional problem: where the devil did they go?  If you last had a popup form open…
I was working on a PowerPoint add-in the other day and a client asked me "can you implement a feature which processes a chart when it's pasted into a slide from another deck?". It got me wondering how to hook into built-in ribbon events in Office.
In Microsoft Access, learn the trick to repeating sub-report headings at the top of each page. The problem with sub-reports and headings: Add a dummy group to the sub report using the expression =1: Set the “Repeat Section” property of the dummy…
In Microsoft Access, learn how to use Dlookup and other domain aggregate functions and one method of specifying a string value within a string. Specify the first argument, which is the expression to be returned: Specify the second argument, which …

743 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

Need Help in Real-Time?

Connect with top rated Experts

16 Experts available now in Live!

Get 1:1 Help Now