Solved

Database problems

Posted on 2006-11-09
9
157 Views
Last Modified: 2013-11-13
Im using DAO to access a database file which contains 92,000 records.  Problem is thats it seems very slow performance wise.
The below line causes a 2-5 second pause which is fairly bad.  Is there any way to improve things?  Would using more tables instead oh having 92,000 records help?
Or would ADO be better?

    Set myrs = db.OpenRecordset(strsql, dbOpenDynaset) ' Causes BIG Pause
0
Comment
Question by:gerrymcd
  • 4
  • 2
  • 2
  • +1
9 Comments
 
LVL 142

Expert Comment

by:Guy Hengel [angelIII / a3]
ID: 17905279
are you trying to get all 92K records using this?
what does the query look like?
does the table have appropriate indexes?
0
 
LVL 142

Expert Comment

by:Guy Hengel [angelIII / a3]
ID: 17905282
ps: what database?
0
 
LVL 2

Author Comment

by:gerrymcd
ID: 17905550
No maybe just 100-300 at a time

typical query

        strsql = "select * from table1 where table1." & sfield & " = '" & sval & "'" '"ORDER BY filename ASC"

i made an index on the filename and path fields it seems to have speeded up the results to some degree.
0
 
LVL 2

Author Comment

by:gerrymcd
ID: 17905590
Typical sql:

select * from table1 where table1.path like '*images\holidays*' AND collectionname = 'holidayphotos2006'  ORDER BY filename ASC

i basically have a collections of images which are contain in a folder and subffolders, theres are image collections (say holiday photos,birthdays,art)

ive put all them in the one table. should i put each collection of images in its own table?

0
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 
LVL 15

Expert Comment

by:JackOfPH
ID: 17911852
It is better not to save the image in your database... instead just save the image path in the database...

0
 
LVL 2

Author Comment

by:gerrymcd
ID: 17913203
the image is not being saved in the database, sry if that was unclear.
0
 
LVL 15

Accepted Solution

by:
JackOfPH earned 125 total points
ID: 17920075
Try to change the query to this...
strsql = "select * from table1 where table1." & sfield & " = '" & sval & "' ORDER BY filename ASC"
0
 
LVL 3

Expert Comment

by:herreruud
ID: 17928885
First of all,
What DB is this? If it's a DB Server, and not Access, it might help to put the SQL in a stored procedure.

Secondly, Is the database running on the same machine as your app? If not; switch to ADO.

0
 
LVL 2

Author Comment

by:gerrymcd
ID: 17928966
ive made each "group of files a collection of images" be made in a new table instead of 1 big tanle with 90,000+ entries it seems to have speeded up things but it makes things a bit akward.  any other tips or ideas?
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

The debugging module of the VB 6 IDE can be accessed by way of the Debug menu item. That menu item can normally be found in the IDE's main menu line as shown in this picture.   There is also a companion Debug Toolbar that looks like the followin…
Most everyone who has done any programming in VB6 knows that you can do something in code like Debug.Print MyVar and that when the program runs from the IDE, the value of MyVar will be displayed in the Immediate Window. Less well known is Debug.Asse…
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…

914 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

20 Experts available now in Live!

Get 1:1 Help Now