MrPan
asked on
Slow response using ADOX Catalog over thin client.
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_Appoint s_Qry").Co mmand '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
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_Appoint
'give the parameters
cmd.Parameters("AP CODE") = (Entity.code)
Wait 0.2
Set ApptRS = New ADODB.Recordset
ApptRS.Open cmd
Thanks MrPan
ASKER
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
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
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
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.
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.
ASKER
Found it at the same time. Great minds.....
ASKER
Many Thanks
Mr Pan
Mr Pan
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