Query large sql server linked table from MS Access (1 Viewer)

kasmax

Registered User.
Local time
Tomorrow, 05:35
Joined
Jun 4, 2012
Messages
38
Hi
I am trying to run query on a large sql server view linked in ms access. the view table has records in millions and I am trying to get data from that view table for around 2300 people. but query always time out/odbc call failed.
I am able to run query if I filter for one person.
I also tried using dao on the form where I run code to fetch data via dao in loop but after 20 or so it fails odbc.
when I run query per person it take around 15 to 20 sec to fetch data for one person as one person has multiple records.

so I cant find a way to fetch data, do one by one would take so much time.

so you guys expert in vba and sql server, is there any way, method, any technique to do this?

thanks for your help
 

Anakardian

Registered User.
Local time
Today, 23:35
Joined
Mar 14, 2010
Messages
173
Have a look at stored procedures and views?
That way the calculation, filtering etc. is done on the server and you only get the result back.
Generally the server is better equipped to do the calculations and filtering anyway so it should save you a lot of time.
 

Galaxiom

Super Moderator
Staff member
Local time
Tomorrow, 07:35
Joined
Jan 20, 2009
Messages
12,851
Does the table have indexes on the columns you are using as the criteria to select? This makes an enormous difference.

Are you joining to an Access table in the query? Heterogeneous queries are usually very slow.

The ODBC timeout can be adjusted in the design view of the query.

Views are not the solution in this case because they don't support parameters.

What are you doing with the data. 2300 is more than anyone can look at at one time, so why get so many records?
 

kasmax

Registered User.
Local time
Tomorrow, 05:35
Joined
Jun 4, 2012
Messages
38
thanks for the replies guys. Firstly the sql server is run by some other ppl and i dont have any user rights to change or create any views or procedures. All i can do is to link and read views data. It seems to me like views dont have indexing. And the reason i want to filter 2300 ppl is because i have to create data report for list of ppl on regular bases.
 

AnthonyGerrard

Registered User.
Local time
Today, 22:35
Joined
Jun 11, 2004
Messages
1,069
YOu coukd use a pass sthrough query. So the sql would be in a sql server format and be processed on eth sql server and the results passed back.

If thats too slow - yes I think teh sql team would have to help you out with indexes or something else to help speed it up.
 

Users who are viewing this thread

Top Bottom