473,383 Members | 1,748 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,383 software developers and data experts.

Too slow to read an entire table from Microsoft Access

Hi, all:
I read a table with 4500 rows and 12 columns using win32com.client.
Reading and updating records are OK, but cost too much time.Especially
making a dict as line(***).
All follows done may take nearly 90s!
Is there any good idea? Thanks.

conn = win32com.client.Dispatch(r'ADODB.Connection')
DSN='Provider=Microsoft.Jet.OLEDB.4.0;Data
Source='+DB_FILE_PATH+';Persist Security Info=False;'
conn.Open(DSN)
record_set = win32com.client.Dispatch(r'ADODB.Recordset')
record_set.Open('[Detail]', conn, 1, 3)
record_set.MoveFirst()

while not record_set.EOF:
tmp = ((record_set.Fields(i).Name, record_set.Fields.Item(i).Value)
for i in range(record_set.Fields.count))
print dict(tmp)
-----------------------------------------------------------------(***)
record_set.MoveNext()
Mar 15 '07 #1
1 1353
On Mar 14, 7:34 pm, lialie <lia...@gmail.comwrote:
I read a table with 4500 rows and 12 columns using win32com.client.
Reading and updating records are OK, but cost too much time.Especially
making a dict as line(***).
All follows done may take nearly 90s!
Is there any good idea? Thanks.
Yeah:

1. Don't use MoveFirst/MoveNext to read. Use GetRows. It's about 60%
faster (on average) in my experience:
http://projects.amor.org/dejavu/brow...y?rev=335#l593

2. Unwind as much of each win32com call as you can, and try to call
InvokeTypes directly. That'll save you another big chunk. See
http://projects.amor.org/dejavu/brow...oreado.py#l700
Robert Brewer
System Architect
Amor Ministries
fu******@amor.org

Mar 15 '07 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

11
by: DJJ | last post by:
I am using the MySQL ODBC 3.51 driver to link three relatively small MySQL tables to a Microsoft Access 2003 database. I am finding that the data from the MySQL tables takes a hell of a long time...
16
by: mamo74 | last post by:
Hello. I am administering a SQL Server (Enterprise Edition on Windows 2003) from some month and can't understand what is going on in the latest week (when the db grow a lot). The DB is around...
29
by: pb648174 | last post by:
I have a very long transaction that runs on the same database that other users need to use for existing data. I don't care if they see data from the transaction before it is done and am only using...
18
by: Mark P | last post by:
I have a bit of vb code that uses Tables.Append to programatically link tables from Oracle and DB2 datasources. The problem I am having on some client machines is that the link will take anywhere...
7
by: ddsvi78 | last post by:
I am a complete idiot when it comes to access. Now that said, I work for a computer security company and one of our customers came to us with an access problem. They had been running fine for a...
5
by: No_Excuses | last post by:
All, I am interested in reading the text of a web page and parsing it. After searching on this newgroup I decided to use the following: ******************************* START OF CODE...
0
by: Andy_Khosravi | last post by:
I'm having a problem trying to optimize the performance of one of my A97 databases. I have very slow record navigation after a change I made to the table structure, and I'm not sure how best to...
5
by: ARC | last post by:
Hello all, I had this e-mail today from a user, and would like to get some ideas to pass along. Many thanks, all! Andy " my program is very very slow when more than two people are using the...
2
by: =?Utf-8?B?SmltIE93ZW4=?= | last post by:
Hi John, Hopefully this post will find its way back to you - or perhaps be answered by someone else. As I mentioned in my last post on the earlier portion of this thread, changing the...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.