Forum Moderators: open
The script does a SELECT on a large table retrieving all records and then loops through them. For each record in the loop it does another SELECT.
Any ideas?
Thanks in advance....
Larry
I was also using ACCESS with DSN, switched to DSN-less, but ran into all kinds of errors so went back to DSN. I think Access should stick with DSN.
SQL server could need some optimizing.
I'm in the process of switching all my Access tables to mySQL for the same reasons - lots more traffic, bigger files, etc.
I'm having no problems with DSN-less connections with Access... I actually read that it is usually faster than using DSN.
I can't figure out why simple SELECTs would be slower with SQL Server though.
This is a huge problem for me because I need to switch to SQL Server due to the high number of connections that are being attempted from my increased user count. Access has trouble with this. It causes big slow downs. Now, if I go to SQL Server, it can handle the connections but the queries are slow.
TERRIBLE! I don't know what to do.
Any ideas?
Thanks....
Larry
The reason for the slow query in the original post could be many reasons. maybe there is a bad route between IIS & SQLServer?
Are you using this in the conection?
Provider=SQLOLEDB;Network=dbmssocn;
I'm having trouble with the syntax trying to do what you suggest.
How would I replace what I currently have to what I should have:
Set DB = Server.CreateObject("ADODB.Connection")
ConnStr = "DRIVER={SQL Server};SERVER=server_name;UID=user_id;PWD=password;DATABASE=db_name"
Thanks for all the help....
Larry
figured it out. But STILL slow.
I think this problem may be that in the transfer from Access, there really aren't any idexes other than the primary key. Maybe I need to define some now? Also, maybe I need to use T-SQL, views and stored procedures?
I still don't understand why the same script would be so slow running SQL Server though. Should still be close to the Access driver, shouldn't it?
Thanks in advance...
Larry
I do realize that as my user base grows, I'll need to switch to SQL Server but before I do that, I'll need to implement stored procedures as much as possible.
Thoughts?
Larry
<quote>
My Host kept telling me that the problem was that Access can't handle that many concurrent users.
</quote>
Yes your provider is correct Access only supports 10 concurrent connections, but that should not be case since connection is usually terminated at page level and ties only one connection.
I'm actually aware of the ASP code to compact the database online... I've tried it out. Seems to work great.
I have a couple of questions about this though...
I understand that when you have quite a few records and then you delete a big chunk in the middle, that space is not cleaned up until you compact. When that space is cleaned up, are the primary keys or indexes renumber to consecutive numbers? If so, how do I avoid referencing problems where I have a field value that is the primary key in one table as an entry in other table? Basically the question is does compacting change ANY field value data including those fields that are keys, indexes, etc?
The other question is when I compact via an ASP script, do I have to make sure that no users try to access the database or make connections during that time?
tomasz, are you saying that while my Host is correct about the number of connection to Access, you agree with me that the number of connections was not really my problem?
Thanks for all of the excellent help....
Larry
Primary Key are not renumbered when an Access database is compacted. That would cause chaos. The data is stored on the disk drive in a more compact fashion so it takes up less space.
Usually when I think of Access, I think about 5-8 simultaneous users beyond that I think you'll want to use SQL Server. It is important to compact your database and recreate your indexes when you have a lot of changes. What is a lot? Say 15% of the records being added or deleted. If things are slow on Access, you might also revisit your database design and try to optimize that.
Just out of curiosity, are all your selects this slow, or just some of them?
You're not doing 'SELECT *' are you?
Yes, indexing will make a difference.
I've narrowed down the query that is causing my slow-down on some pages.
I'm doing a SELECT COUNT(*).
I have the same content in an Access DB and in an SQL Server DB.
When I do the above query with the COUNT(*) function, the SQL Server is INCREDIBLY slow! I'm doing the select on a fairly large table with over 100K records.
I'm sure it would be better to do the count with a stored procedure in SQL Server, but a new to SQL Server so I haven't learned how to implement a stored procedure yet and access the result through my ASP.
Ideas about the slowness?
Thanks for all the great help...
Larry