BorlandTalk.com Forum Index BorlandTalk.com
Borland discussion newsgroups
 
Archives   FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

UPDATE SQL for Excel - very slow - any suggestions?

 
Post new topic   Reply to topic    BorlandTalk.com Forum Index -> Delphi Databases (ADO)
View previous topic :: View next topic  
Author Message
Guillem
Guest





PostPosted: Mon Jan 23, 2006 12:28 pm    Post subject: Re: UPDATE SQL for Excel - very slow - any suggestions? Reply with quote



Martin B wrote:

Quote:
Hello world,

I am using ADO components to connect to a datasource; the user can
connect to Excel sheets, Access or any other database.

After using the program, the user will want to update certain fields
in the datasource. I have implemented this with standard "UPDATE"
SQL queries. This works fine with Access. But with Excel sheets it
is very slow (factor 60). This is probably due to the fact that
there is no index in the key fields in Excel.

Any suggestions?

Regards,
Martin

this is probably not what you want to hear but my first suggestion
would be to forget SQL sentences for Excel. Try doing it directly per
code.

Additionally, you could try using DisableControls before beginning the
operation and EnableControls after it. That usually helps to make it
faster although I seriously doubt it will solve your problem completely

--
Best regards :)

Guillem Vicens Meier
Dep. Informatica Green Service S.A.
www.clubgreenoasis.com
--
Contribute to the Indy Docs project: http://docs.indyproject.org
--
In order to contact me remove the -nospam


Back to top
Martin B
Guest





PostPosted: Mon Jan 23, 2006 12:57 pm    Post subject: UPDATE SQL for Excel - very slow - any suggestions? Reply with quote



Hello world,

I am using ADO components to connect to a datasource; the user can
connect to Excel sheets, Access or any other database.

After using the program, the user will want to update certain fields in the
datasource.
I have implemented this with standard "UPDATE" SQL queries.
This works fine with Access. But with Excel sheets it is very slow (factor
60).
This is probably due to the fact that there is no index in the key fields in
Excel.

Any suggestions?

Regards,
Martin


Back to top
Vitali Kalinin
Guest





PostPosted: Mon Jan 23, 2006 1:44 pm    Post subject: Re: UPDATE SQL for Excel - very slow - any suggestions? Reply with quote




"Martin B" <mb (AT) mb (DOT) com> сообщил/сообщила в новостях следующее:
news:43d4d212$1 (AT) newsgroups (DOT) borland.com...
Quote:
Hello world,

I am using ADO components to connect to a datasource; the user can
connect to Excel sheets, Access or any other database.

After using the program, the user will want to update certain fields in
the datasource.
I have implemented this with standard "UPDATE" SQL queries.
This works fine with Access. But with Excel sheets it is very slow (factor
60).
This is probably due to the fact that there is no index in the key fields
in Excel.

Any suggestions?

Regards,
Martin

AFAIK TADODataSet with CommandType = cmdTableDirect and CursorLocation =
clUseServer is fastest for append data in Excel with ADO, so you can try
this combination for Update. Also I think that yours guess about
inefficiency of using where clause for un-indexed data could be quite valid,
so you can switch to referencing of target cells by there Excel coordinate
instead. Please let us know on yours results if any.



Regards,

Vitali



Back to top
Martin B
Guest





PostPosted: Tue Jan 24, 2006 1:03 pm    Post subject: Re: UPDATE SQL for Excel - very slow - any suggestions? Reply with quote

I just tried that.
It is too slow, and I also need to create columns that may be missing in the
input table.
I am using a memory table instead.
By the way, doesn't the ADODataSet use UPDATE SQL in the background?




"Brian Bushay TeamB" <BBushay (AT) Nmpls (DOT) com> wrote

Quote:

Hello world,

I am using ADO components to connect to a datasource; the user can
connect to Excel sheets, Access or any other database.

After using the program, the user will want to update certain fields in
the
datasource.
I have implemented this with standard "UPDATE" SQL queries.
This works fine with Access. But with Excel sheets it is very slow (factor
60).
This is probably due to the fact that there is no index in the key fields
in
Excel.

Any suggestions?

Don't use SQL
Use a TadoDataset set the commandType to cmdTableDirect
commandText to the datasheet you want to edit
Then make all your changes directly to the tadoDataset
--
Brian Bushay (TeamB)
[email]Bbushay (AT) NMPLS (DOT) com[/email]



Back to top
Display posts from previous:   
Post new topic   Reply to topic    BorlandTalk.com Forum Index -> Delphi Databases (ADO) All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2006 phpBB Group
SEO toolkit © 2004-2006 webmedic.