Ureader.com  
Microsoft software help and Community
   home   |   control panel login   |   archive   |  
 
Access
3rdpartyusrgrp
access
activexcontrol
adp.sqlserver
commandbarsui
conversion
dataaccess.pages
developers.toolkitode
devtoolkits
externaldata
forms
formscoding
gettingstarted
internet
interopoledde
macros
modulescoding
modulesdaovba
modulesdaovba.ado
multiuser
odbcclientsvr
queries
replication
reports
security
setupconfig
tablesdbdesign
  
 
date: Wed, 10 Oct 2007 09:54:52 +0200,    group: microsoft.public.access.odbcclientsvr        back       


ODBC mysql-access slow   
I have a data base Access that links to another mysql by 
mysql-connector-odbc-3.51.12. If I execute a query by odbc to a table with 
1000 records this query takes between 5 and 6 minutes, whereas if I directly 
execute it in server it takes less of a second. what I can do so that it is 
executed but fast?
date: Wed, 10 Oct 2007 09:54:52 +0200   author:   Javcal

Re: ODBC mysql-access slow   
hi,

Javcal wrote:
> I have a data base Access that links to another mysql by 
> mysql-connector-odbc-3.51.12. If I execute a query by odbc to a table with 
> 1000 records this query takes between 5 and 6 minutes, whereas if I directly 
> execute it in server it takes less of a second. what I can do so that it is 
> executed but fast?
Have you checked your network connection? What throughput do you have, 
what kind of connection is it LAN, WLAN or broadband?

I don't think that this is an Access issue. I have used this drivers 
succesfully without having issues like yours.


mfG
--> stefan <--
date: Wed, 10 Oct 2007 10:01:21 +0200   author:   Stefan Hoffmann

Re: ODBC mysql-access slow   
"Stefan Hoffmann"  escribió en el mensaje 
news:%23mQ77OxCIHA.2060@TK2MSFTNGP06.phx.gbl...
> hi,
>
> Javcal wrote:
>> I have a data base Access that links to another mysql by 
>> mysql-connector-odbc-3.51.12. If I execute a query by odbc to a table 
>> with 1000 records this query takes between 5 and 6 minutes, whereas if I 
>> directly execute it in server it takes less of a second. what I can do so 
>> that it is executed but fast?
> Have you checked your network connection? What throughput do you have, 
> what kind of connection is it LAN, WLAN or broadband?
>
> I don't think that this is an Access issue. I have used this drivers 
> succesfully without having issues like yours.
>
>
> mfG
> --> stefan <--

Hi Stefan.

I tested my connection and I think it can be the problem, because if I 
exceute the query in a lan this takes about 10 secs, but the problem becomes 
in the localitation of database. I think that access dont work fast with 
databases out of lan. how do you make to work with access and to comunicate 
with other databases out of lan?
date: Wed, 10 Oct 2007 10:47:58 +0200   author:   Javcal

Re: ODBC mysql-access slow   
hi,

Javcal wrote:
> I tested my connection and I think it can be the problem, because if I 
> exceute the query in a lan this takes about 10 secs, but the problem becomes 
> in the localitation of database. I think that access dont work fast with 
> databases out of lan. how do you make to work with access and to comunicate 
> with other databases out of lan? 
So you are using a broadband connection and your MySQL server is located 
at some (web-)server?

Can you outline your working scenario a little bit?


mfG
--> stefan <--
date: Wed, 10 Oct 2007 11:08:17 +0200   author:   Stefan Hoffmann

Re: ODBC mysql-access slow   
like you suposed, my mysql database is located at a webserver, there is a 
table with 1000 products, and I would like update prices and stoks from my 
access 2003 database.


"Stefan Hoffmann"  escribió en el mensaje 
news:%23$VXV0xCIHA.1184@TK2MSFTNGP04.phx.gbl...
> hi,
>
> Javcal wrote:
>> I tested my connection and I think it can be the problem, because if I 
>> exceute the query in a lan this takes about 10 secs, but the problem 
>> becomes in the localitation of database. I think that access dont work 
>> fast with databases out of lan. how do you make to work with access and 
>> to comunicate with other databases out of lan?
> So you are using a broadband connection and your MySQL server is located 
> at some (web-)server?
>
> Can you outline your working scenario a little bit?
>
>
> mfG
> --> stefan <--
date: Wed, 10 Oct 2007 11:29:21 +0200   author:   Javcal

Re: ODBC mysql-access slow   
hi,

Javcal wrote:
> like you suposed, my mysql database is located at a webserver, there is a 
> table with 1000 products, and I would like update prices and stoks from my 
> access 2003 database.
Then you cannot do anything to improve the speed whilst using the MySQL 
ODBC driver beside getting a faster connection.

You may consider this:

When starting your application, copy the data from your MySQL server to 
local tables.
Make copies of these tables.

Change your data locally.

Compare the changed tables with the copies of tables.
Create SQL scripts for DELETE, INSERT and UPDATE.

Zip these scripts, FTP them to the server, unpack them, and execute them 
on the server.


mfG
--> stefan <--
date: Wed, 10 Oct 2007 11:37:28 +0200   author:   Stefan Hoffmann

Re: ODBC mysql-access slow   
Hi,
try to use pass-through query, if you don't need to update data

-- 
Best regards,
___________
Alex Dybenko (MVP)
http://accessblog.net
http://www.PointLtd.com

"Javcal"  wrote in message 
news:e$eqWLxCIHA.2268@TK2MSFTNGP02.phx.gbl...
>I have a data base Access that links to another mysql by 
>mysql-connector-odbc-3.51.12. If I execute a query by odbc to a table with 
>1000 records this query takes between 5 and 6 minutes, whereas if I 
>directly execute it in server it takes less of a second. what I can do so 
>that it is executed but fast?
>
>
>
date: Wed, 10 Oct 2007 14:26:37 +0400   author:   Alex Dybenko

Re: ODBC mysql-access slow   
Ok, this is an easy solution, but this solution implices to run a process at 
server and I dont know how do this, for example: I export tables to a txt 
file, after that I zip this file and send it to server, but in server... 
what I have to do to unzip and insert this zip on database?, and if I want 
to do it from server to my local PC?


"Stefan Hoffmann"  escribió en el mensaje 
news:ukA9oEyCIHA.5208@TK2MSFTNGP04.phx.gbl...
> hi,
>
> Javcal wrote:
>> like you suposed, my mysql database is located at a webserver, there is a 
>> table with 1000 products, and I would like update prices and stoks from 
>> my access 2003 database.
> Then you cannot do anything to improve the speed whilst using the MySQL 
> ODBC driver beside getting a faster connection.
>
> You may consider this:
>
> When starting your application, copy the data from your MySQL server to 
> local tables.
> Make copies of these tables.
>
> Change your data locally.
>
> Compare the changed tables with the copies of tables.
> Create SQL scripts for DELETE, INSERT and UPDATE.
>
> Zip these scripts, FTP them to the server, unpack them, and execute them 
> on the server.
>
>
> mfG
> --> stefan <--
date: Wed, 10 Oct 2007 12:28:12 +0200   author:   Javcal

Re: ODBC mysql-access slow   
thank you very much. this has been a great discovery for my.

I did a pass-through query and it made the query in 1 sec, but if I want 
insert or update from my local table it fails, what do I have to do to up my 
tables to server as fast as a pass-through query?





"Alex Dybenko"  escribio en el mensaje 
news:ujJdLgyCIHA.3848@TK2MSFTNGP05.phx.gbl...
> Hi,
> try to use pass-through query, if you don't need to update data
>
> -- 
> Best regards,
> ___________
> Alex Dybenko (MVP)
> http://accessblog.net
> http://www.PointLtd.com
>
> "Javcal"  wrote in message 
> news:e$eqWLxCIHA.2268@TK2MSFTNGP02.phx.gbl...
>>I have a data base Access that links to another mysql by 
>>mysql-connector-odbc-3.51.12. If I execute a query by odbc to a table with 
>>1000 records this query takes between 5 and 6 minutes, whereas if I 
>>directly execute it in server it takes less of a second. what I can do so 
>>that it is executed but fast?
>>
>>
>>
>
date: Wed, 10 Oct 2007 14:28:00 +0200   author:   Javcal

Re: ODBC mysql-access slow   
hi,

Javcal wrote:
> I did a pass-through query and it made the query in 1 sec, but if I want 
> insert or update from my local table it fails, what do I have to do to up my 
> tables to server as fast as a pass-through query?
Passthrough queries are read only.

You may create them on the fly with VBA then you can use it to execute a 
INSERT or UPDATE statement.

E.g. You have a passthrough query name "PT"

   With CurrentDb
        .QueryDefs.Item("PT").SQL = "UPDATE tableOnServer " & _
                                    "SET field = value ..."
   End With


mfG
--> stefan <--
date: Wed, 10 Oct 2007 14:59:03 +0200   author:   Stefan Hoffmann

Re: ODBC mysql-access slow   
OK, but if I want insert 1000 records from a local table to web table, I'm 
sure that it will be bery slow because I'll have to build 1000 times the sql 
of query an execute 1000 times this query...


"Stefan Hoffmann"  escribió en el mensaje 
news:uGg0R1zCIHA.1184@TK2MSFTNGP04.phx.gbl...
> hi,
>
> Javcal wrote:
>> I did a pass-through query and it made the query in 1 sec, but if I want 
>> insert or update from my local table it fails, what do I have to do to up 
>> my tables to server as fast as a pass-through query?
> Passthrough queries are read only.
>
> You may create them on the fly with VBA then you can use it to execute a 
> INSERT or UPDATE statement.
>
> E.g. You have a passthrough query name "PT"
>
>   With CurrentDb
>        .QueryDefs.Item("PT").SQL = "UPDATE tableOnServer " & _
>                                    "SET field = value ..."
>   End With
>
>
> mfG
> --> stefan <--
>
date: Wed, 10 Oct 2007 15:39:21 +0200   author:   Javcal

Re: ODBC mysql-access slow   
hi,

Javcal wrote:
> OK, but if I want insert 1000 records from a local table to web table, I'm 
> sure that it will be bery slow because I'll have to build 1000 times the sql 
> of query an execute 1000 times this query...
This correct. But you can use a MySQL feature here. You can place 
multiple INSERT statements in your passthrough query and execute it once 
in a batch. E.g.

  .QueryDefs.Item("PT").SQL = insertSQL1 & vbCrLf & _
                              .. & _
                              insertSQL1000



mfG
--> stefan <--
date: Wed, 10 Oct 2007 16:10:13 +0200   author:   Stefan Hoffmann

Re: ODBC mysql-access slow   
very good idea, but as always I look for problems to it. I suppose that the 
string will have a shortest limit than the volume of data that I want to 
insert, so it will continue been slow.


"Stefan Hoffmann"  escribió en el mensaje 
news:O1npDd0CIHA.3332@TK2MSFTNGP04.phx.gbl...
> hi,
>
> Javcal wrote:
>> OK, but if I want insert 1000 records from a local table to web table, 
>> I'm sure that it will be bery slow because I'll have to build 1000 times 
>> the sql of query an execute 1000 times this query...
> This correct. But you can use a MySQL feature here. You can place multiple 
> INSERT statements in your passthrough query and execute it once in a 
> batch. E.g.
>
>  .QueryDefs.Item("PT").SQL = insertSQL1 & vbCrLf & _
>                              .. & _
>                              insertSQL1000
>
>
>
> mfG
> --> stefan <--
date: Thu, 11 Oct 2007 10:04:29 +0200   author:   Javcal

Re: ODBC mysql-access slow   
There is no problem with the long of the string (63000), but I try to insert 
100 records and it late 1 minute, so it isn't fast. Do you have other idea?

thank you



"Javcal"  escribió en el mensaje 
news:OY5UZ19CIHA.4752@TK2MSFTNGP04.phx.gbl...
> very good idea, but as always I look for problems to it. I suppose that 
> the string will have a shortest limit than the volume of data that I want 
> to insert, so it will continue been slow.
>
>
> "Stefan Hoffmann"  escribió en el mensaje 
> news:O1npDd0CIHA.3332@TK2MSFTNGP04.phx.gbl...
>> hi,
>>
>> Javcal wrote:
>>> OK, but if I want insert 1000 records from a local table to web table, 
>>> I'm sure that it will be bery slow because I'll have to build 1000 times 
>>> the sql of query an execute 1000 times this query...
>> This correct. But you can use a MySQL feature here. You can place 
>> multiple INSERT statements in your passthrough query and execute it once 
>> in a batch. E.g.
>>
>>  .QueryDefs.Item("PT").SQL = insertSQL1 & vbCrLf & _
>>                              .. & _
>>                              insertSQL1000
>>
>>
>>
>> mfG
>> --> stefan <-- 
>
>
date: Thu, 11 Oct 2007 10:44:39 +0200   author:   Javcal

Re: ODBC mysql-access slow   
hi,

Javcal wrote:
> There is no problem with the long of the string (63000), but I try to insert 
> 100 records and it late 1 minute, so it isn't fast. Do you have other idea?
No, because the problem is the speed of your broadband line. As long as 
you can't get any faster line, there is not really anything you can do.

If your MySQL runs on a Windows machine with installed Terminal Services 
you can run your application local to your MySQL server, but I assume 
that is not an option.


mfG
--> stefan <--
date: Thu, 11 Oct 2007 11:37:15 +0200   author:   Stefan Hoffmann

Re: ODBC mysql-access slow   
I think that I have not explained well (my English is very bad). I have 
copied the string of 100 insertions in the window of mysql and has taken 1 
minute in inserting the 100 registries, reason why one is not affected by my 
speed of connection.


Private Sub Subir_Servidor()
    Dim Rec As DAO.Recordset
    Dim MyDb As Database
    Dim MyQ As QueryDef
    Dim Cont As Long

    Cont = 0
    Set MyDb = CurrentDb()
    Set MyQ = MyDb.CreateQueryDef("")

    MyQ.Connect = 
"ODBC;DATABASE=xxx;DESCRIPTION=xxx;DSN=xxx;OPTION=18699;PWD=xxx;PORT=xxx;SERVER=xxx;UID=calamobel"
    MyQ.ReturnsRecords = False
    MyQ.sql = " "
    Set Rec = CurrentDb.OpenRecordset("Albaranes_lineas_pruebas")
    Do While Not Rec.EOF Or Cont < 100 ' limito los registros a subir
        If Len(MyQ.sql) > 50000 Then
            MyQ.Execute
            Cont = 0
        Else
            MyQ.sql = "INSERT INTO Albaranes " & _
            "( IdAlbaran, Tienda, Linea, Referencia, Descripcion, Precio, 
Descuento, Cant_Mandada, Cant_Recepcionada, IdColor, IdPedido, Subido, 
Bajado, Facturado )" & _
            " values ( '" & Rec(0) & "' ,'" & Rec(1) & "' ,'" & Rec(2) & "' 
,'" & Rec(3) & "' ,'" & Rec(4) & "' ,'" & Rec(5) & "' ,'" & Rec(6) & "' ,'" 
& Rec(7) & "' ,'" & Rec(8) & "' , '" & _
            Rec(9) & "' ,'" & Nz(Rec(10), 0) & "' ,'" & CInt(Rec(11)) & "' 
,'" & CInt(Rec(12)) & "' ,'" & CInt(Rec(13)) & "' );" & vbCrLf & MyQ.sql
        Cont = Cont + 1
        End If
        Rec.MoveNext
    Loop
    If Cont > 0 Then
        MyQ.Execute
    End If
    Rec.Close
    MyQ.Close
    MyDb.Close
End Sub

The resulted string is like this:
INSERT INTO Albaranes ( IdAlbaran, .....) values ( '436' ,.....);
INSERT INTO Albaranes ( IdAlbaran, .....) values ( '436' ,.....);
.......

when sub arrives to MsQ.Execute send an error, but if I copy the string and 
after that I paste it to MySql query window, it runs perfectly, but slow



"Stefan Hoffmann"  escribió en el mensaje 
news:uDdxLp%23CIHA.5228@TK2MSFTNGP05.phx.gbl...
> hi,
>
> Javcal wrote:
>> There is no problem with the long of the string (63000), but I try to 
>> insert 100 records and it late 1 minute, so it isn't fast. Do you have 
>> other idea?
> No, because the problem is the speed of your broadband line. As long as 
> you can't get any faster line, there is not really anything you can do.
>
> If your MySQL runs on a Windows machine with installed Terminal Services 
> you can run your application local to your MySQL server, but I assume that 
> is not an option.
>
>
> mfG
> --> stefan <--
date: Thu, 11 Oct 2007 12:14:05 +0200   author:   Javcal

Re: ODBC mysql-access slow   
hi,

Javcal wrote:
> I think that I have not explained well (my English is very bad). I have 
> copied the string of 100 insertions in the window of mysql and has taken 1 
> minute in inserting the 100 registries, reason why one is not affected by my 
> speed of connection.
Was this MySQL window local to your machine or was it a web interface 
like MyPhpAdmin?

One minute for 100 inserts in not really fast.

> when sub arrives to MsQ.Execute send an error, but if I copy the string and 
> after that I paste it to MySql query window, it runs perfectly, but slow
What error message and code do you get exactly?


mfG
--> stefan <--
date: Thu, 11 Oct 2007 14:20:58 +0200   author:   Stefan Hoffmann

Re: ODBC mysql-access slow   
Hi Javcal,

First...I am no expert but I thought passthru's could
only have one SQL stmt (I could be wrong).

Second...our company interacts with several websites
where we just upload tab-delimited files to update what
we sell on their sites. Is it possible that might be a strategy
you could implement?

I *know nothing about MySQL* but in SQL Server I could
imagine a stored procedure that accepts a string parameter
that could be tab-delimited (or xml) string {or filepath on server
where you just uploaded it}, then updates db.

one possible example:

your code below would collect values in string var (say "strPar"),
then when done feeds it to stored proc (say "xsp_upload")

MyQ.sql = "EXECUTE xsp_upload " & strPar
MyQ.Execute

Sorry...just what I thought about when I read your posts...

gary

"Javcal"wrote:
>I think that I have not explained well (my English is very bad). I have 
>copied the string of 100 insertions in the window of mysql and has taken 1 
>minute in inserting the 100 registries, reason why one is not affected by 
>my speed of connection.
>
>
> Private Sub Subir_Servidor()
>    Dim Rec As DAO.Recordset
>    Dim MyDb As Database
>    Dim MyQ As QueryDef
>    Dim Cont As Long
>
>    Cont = 0
>    Set MyDb = CurrentDb()
>    Set MyQ = MyDb.CreateQueryDef("")
>
>    MyQ.Connect = 
> "ODBC;DATABASE=xxx;DESCRIPTION=xxx;DSN=xxx;OPTION=18699;PWD=xxx;PORT=xxx;SERVER=xxx;UID=calamobel"
>    MyQ.ReturnsRecords = False
>    MyQ.sql = " "
>    Set Rec = CurrentDb.OpenRecordset("Albaranes_lineas_pruebas")
>    Do While Not Rec.EOF Or Cont < 100 ' limito los registros a subir
>        If Len(MyQ.sql) > 50000 Then
>            MyQ.Execute
>            Cont = 0
>        Else
>            MyQ.sql = "INSERT INTO Albaranes " & _
>            "( IdAlbaran, Tienda, Linea, Referencia, Descripcion, Precio, 
> Descuento, Cant_Mandada, Cant_Recepcionada, IdColor, IdPedido, Subido, 
> Bajado, Facturado )" & _
>            " values ( '" & Rec(0) & "' ,'" & Rec(1) & "' ,'" & Rec(2) & "' 
> ,'" & Rec(3) & "' ,'" & Rec(4) & "' ,'" & Rec(5) & "' ,'" & Rec(6) & "' 
> ,'" & Rec(7) & "' ,'" & Rec(8) & "' , '" & _
>            Rec(9) & "' ,'" & Nz(Rec(10), 0) & "' ,'" & CInt(Rec(11)) & "' 
> ,'" & CInt(Rec(12)) & "' ,'" & CInt(Rec(13)) & "' );" & vbCrLf & MyQ.sql
>        Cont = Cont + 1
>        End If
>        Rec.MoveNext
>    Loop
>    If Cont > 0 Then
>        MyQ.Execute
>    End If
>    Rec.Close
>    MyQ.Close
>    MyDb.Close
> End Sub
>
> The resulted string is like this:
> INSERT INTO Albaranes ( IdAlbaran, .....) values ( '436' ,.....);
> INSERT INTO Albaranes ( IdAlbaran, .....) values ( '436' ,.....);
> .......
>
> when sub arrives to MsQ.Execute send an error, but if I copy the string 
> and after that I paste it to MySql query window, it runs perfectly, but 
> slow
>
>
>
> "Stefan Hoffmann"  escribió en el mensaje 
> news:uDdxLp%23CIHA.5228@TK2MSFTNGP05.phx.gbl...
>> hi,
>>
>> Javcal wrote:
>>> There is no problem with the long of the string (63000), but I try to 
>>> insert 100 records and it late 1 minute, so it isn't fast. Do you have 
>>> other idea?
>> No, because the problem is the speed of your broadband line. As long as 
>> you can't get any faster line, there is not really anything you can do.
>>
>> If your MySQL runs on a Windows machine with installed Terminal Services 
>> you can run your application local to your MySQL server, but I assume 
>> that is not an option.
>>
>>
>> mfG
>> --> stefan <-- 
>
>
date: Thu, 11 Oct 2007 07:34:45 -0500   author:   Gary Walter

Re: ODBC mysql-access slow   
it's true, it's send from local machine, when I run from server directly it 
goes faster.
I think that I'm going to build a function who ups a txt file to server with 
the query results and after that I'm going to execute a store procedure to 
insert data. I upped one file with 8500 records and it lates 30 secs in up 
an 1 sec in insert... I think is the best option


"Stefan Hoffmann"  escribió en el mensaje 
news:eWLpqEADIHA.5160@TK2MSFTNGP05.phx.gbl...
> hi,
>
> Javcal wrote:
>> I think that I have not explained well (my English is very bad). I have 
>> copied the string of 100 insertions in the window of mysql and has taken 
>> 1 minute in inserting the 100 registries, reason why one is not affected 
>> by my speed of connection.
> Was this MySQL window local to your machine or was it a web interface like 
> MyPhpAdmin?
>
> One minute for 100 inserts in not really fast.
>
>> when sub arrives to MsQ.Execute send an error, but if I copy the string 
>> and after that I paste it to MySql query window, it runs perfectly, but 
>> slow
> What error message and code do you get exactly?
>
>
> mfG
> --> stefan <--
date: Thu, 11 Oct 2007 17:54:22 +0200   author:   Javcal

Google
 
Web ureader.com


    COPYRIGHT 2007, YARDI TECHNOLOGY LIMITED, ALL RIGHT RESERVE  |   contact us