473,287 Members | 1,960 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,287 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 1351
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...
2
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 7 Feb 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:30 (7.30PM). In this month's session, the creator of the excellent VBE...
0
by: MeoLessi9 | last post by:
I have VirtualBox installed on Windows 11 and now I would like to install Kali on a virtual machine. However, on the official website, I see two options: "Installer images" and "Virtual machines"....
0
by: DolphinDB | last post by:
The formulas of 101 quantitative trading alphas used by WorldQuant were presented in the paper 101 Formulaic Alphas. However, some formulas are complex, leading to challenges in calculation. Take...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: Aftab Ahmad | last post by:
Hello Experts! I have written a code in MS Access for a cmd called "WhatsApp Message" to open WhatsApp using that very code but the problem is that it gives a popup message everytime I clicked on...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...

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.