473,386 Members | 1,823 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,386 software developers and data experts.

ASP slow reading from mySQL

I have a mySQL database, called clients it has a single table called client
with 2325 records in it. It was originally an Access database but I have
exported it to mySQL.
I have created a system DSN that connects fine. the following code works a
treat. I get Connection Successful printed to my browser.

<%
on error resume next
dim adoConn
set adoConn = Server.CreateObject("ADODB.Connection")
adoConn.Open "DSN=ClientsDatabase"
if adoConn.errors.count = 0 then
response.write "Connection Successful!"
else
response.write "ERROR: Couldn't connect to database"
end if
%>

However when I rty to access any data in the database it takes forever and
when I say forever I mean I've been sitting here for 10 mins with nothing. I
have hte blue progress bar in IE about half way but nothing is being
displayed. Here is my code

<%
on error resume next
dim adoConn
dim adoRS
dim counter
set adoConn = Server.CreateObject("ADODB.Connection")
set adoRS = Server.CreateObject("ADODB.Recordset")
adoConn.Open "DSN=ClientsDatabase"
adoRS.Open "SELECT agent FROM 'client' WHERE agent='Intercars'", conn
adoRS.MoveFirst
do until adoRS.EOF
response.write adoRS.fields(0).value & "<br>"
adoRS.MoveNext
loop
adoRS.close
adoConn.close
%>

What am I doing wrong, surely 2325 records is not a lot!

Thanks

Stu

--
Don: I didn't know you had a cousin Penelope, Bill! Was she
pretty?
W. C.: Well, her face was so wrinkled it looked like seven miles of
bad road. She had so many gold teeth, Don, she use to have to
sleep with her head in a safe. She died in Bolivia.
Don: Oh Bill, it must be hard to lose a relative.
W. C.: It's almost impossible.
-- W. C. Fields, from "The Further Adventures of Larson
E. Whipsnade and other Tarradiddles"
Jul 19 '05 #1
5 2091
Stuart,

if you run the query on the server its fast?

i cant understand though why you want to display so many records? have you
thought any on how large the rendered html file is? a couple of Mb's?

/Lasse

"Stuart Mueller" <I.*********@email.address> wrote in message
news:Ob*************@tk2msftngp13.phx.gbl...
I have a mySQL database, called clients it has a single table called client with 2325 records in it. It was originally an Access database but I have
exported it to mySQL.
I have created a system DSN that connects fine. the following code works a
treat. I get Connection Successful printed to my browser.

<%
on error resume next
dim adoConn
set adoConn = Server.CreateObject("ADODB.Connection")
adoConn.Open "DSN=ClientsDatabase"
if adoConn.errors.count = 0 then
response.write "Connection Successful!"
else
response.write "ERROR: Couldn't connect to database"
end if
%>

However when I rty to access any data in the database it takes forever and
when I say forever I mean I've been sitting here for 10 mins with nothing. I have hte blue progress bar in IE about half way but nothing is being
displayed. Here is my code

<%
on error resume next
dim adoConn
dim adoRS
dim counter
set adoConn = Server.CreateObject("ADODB.Connection")
set adoRS = Server.CreateObject("ADODB.Recordset")
adoConn.Open "DSN=ClientsDatabase"
adoRS.Open "SELECT agent FROM 'client' WHERE agent='Intercars'", conn
adoRS.MoveFirst
do until adoRS.EOF
response.write adoRS.fields(0).value & "<br>"
adoRS.MoveNext
loop
adoRS.close
adoConn.close
%>

What am I doing wrong, surely 2325 records is not a lot!

Thanks

Stu

--
Don: I didn't know you had a cousin Penelope, Bill! Was she
pretty?
W. C.: Well, her face was so wrinkled it looked like seven miles of
bad road. She had so many gold teeth, Don, she use to have to
sleep with her head in a safe. She died in Bolivia.
Don: Oh Bill, it must be hard to lose a relative.
W. C.: It's almost impossible.
-- W. C. Fields, from "The Further Adventures of Larson
E. Whipsnade and other Tarradiddles"

Jul 19 '05 #2
one more thing:

<html>
<body>
<%
dim adoConn
dim adoRS
dim counter
set adoConn = Server.CreateObject("ADODB.Connection")
set adoRS = Server.CreateObject("ADODB.Recordset")
adoConn.Open "DSN=ClientsDatabase"
adoRS.Open "SELECT agent FROM 'client' WHERE agent='Intercars'", conn

do until adoRS.EOF
%>
<%=adoRS.fields(0).value%><br>
<%
adoRS.MoveNext
loop
adoRS.close
adoConn.close
%>
</body>
</html>

and get rid of that on error resume next thing!!

use OleDB provider connecting to database, fastest way


"Stuart Mueller" <I.*********@email.address> wrote in message
news:Ob*************@tk2msftngp13.phx.gbl...
I have a mySQL database, called clients it has a single table called client with 2325 records in it. It was originally an Access database but I have
exported it to mySQL.
I have created a system DSN that connects fine. the following code works a
treat. I get Connection Successful printed to my browser.

<%
on error resume next
dim adoConn
set adoConn = Server.CreateObject("ADODB.Connection")
adoConn.Open "DSN=ClientsDatabase"
if adoConn.errors.count = 0 then
response.write "Connection Successful!"
else
response.write "ERROR: Couldn't connect to database"
end if
%>

However when I rty to access any data in the database it takes forever and
when I say forever I mean I've been sitting here for 10 mins with nothing. I have hte blue progress bar in IE about half way but nothing is being
displayed. Here is my code

<%
on error resume next
dim adoConn
dim adoRS
dim counter
set adoConn = Server.CreateObject("ADODB.Connection")
set adoRS = Server.CreateObject("ADODB.Recordset")
adoConn.Open "DSN=ClientsDatabase"
adoRS.Open "SELECT agent FROM 'client' WHERE agent='Intercars'", conn
adoRS.MoveFirst
do until adoRS.EOF
response.write adoRS.fields(0).value & "<br>"
adoRS.MoveNext
loop
adoRS.close
adoConn.close
%>

What am I doing wrong, surely 2325 records is not a lot!

Thanks

Stu

--
Don: I didn't know you had a cousin Penelope, Bill! Was she
pretty?
W. C.: Well, her face was so wrinkled it looked like seven miles of
bad road. She had so many gold teeth, Don, she use to have to
sleep with her head in a safe. She died in Bolivia.
Don: Oh Bill, it must be hard to lose a relative.
W. C.: It's almost impossible.
-- W. C. Fields, from "The Further Adventures of Larson
E. Whipsnade and other Tarradiddles"

Jul 19 '05 #3
I have not worked with mySQL but is working when you quote the table name in
the from clause?

adoRS.Open "SELECT agent FROM 'client' WHERE agent='Intercars'", conn
^ ^
Regards
/Hans
Jul 19 '05 #4
Yes, it is correct to quote the table. It is not necessay but it is correct.
This is most probably because mysql allows spaces in table names.

--
Fadi El-Eter, itoctopus - http://www.itoctopus.com
"Hans" <ha***@sorry.nospam.com> wrote in message
news:uO**************@TK2MSFTNGP11.phx.gbl...
I have not worked with mySQL but is working when you quote the table name in the from clause?

adoRS.Open "SELECT agent FROM 'client' WHERE agent='Intercars'", conn
^ ^
Regards
/Hans

Jul 19 '05 #5
you should download the MySQL ODBC 3.51 for MySQL from there website.

my mysql connection string looks more like.

"driver={MySQL ODBC 3.51
Driver};server=myserver;database=mydatabase;uid=my username;pwd=myuserpass"

but i would say this has more to do with the fact that your pulling 2325
records at once. that is a hell of allot.
"Stuart Mueller" <I.*********@email.address> wrote in message
news:Ob*************@tk2msftngp13.phx.gbl...
I have a mySQL database, called clients it has a single table called client with 2325 records in it. It was originally an Access database but I have
exported it to mySQL.
I have created a system DSN that connects fine. the following code works a
treat. I get Connection Successful printed to my browser.

<%
on error resume next
dim adoConn
set adoConn = Server.CreateObject("ADODB.Connection")
adoConn.Open "DSN=ClientsDatabase"
if adoConn.errors.count = 0 then
response.write "Connection Successful!"
else
response.write "ERROR: Couldn't connect to database"
end if
%>

However when I rty to access any data in the database it takes forever and
when I say forever I mean I've been sitting here for 10 mins with nothing. I have hte blue progress bar in IE about half way but nothing is being
displayed. Here is my code

<%
on error resume next
dim adoConn
dim adoRS
dim counter
set adoConn = Server.CreateObject("ADODB.Connection")
set adoRS = Server.CreateObject("ADODB.Recordset")
adoConn.Open "DSN=ClientsDatabase"
adoRS.Open "SELECT agent FROM 'client' WHERE agent='Intercars'", conn
adoRS.MoveFirst
do until adoRS.EOF
response.write adoRS.fields(0).value & "<br>"
adoRS.MoveNext
loop
adoRS.close
adoConn.close
%>

What am I doing wrong, surely 2325 records is not a lot!

Thanks

Stu

--
Don: I didn't know you had a cousin Penelope, Bill! Was she
pretty?
W. C.: Well, her face was so wrinkled it looked like seven miles of
bad road. She had so many gold teeth, Don, she use to have to
sleep with her head in a safe. She died in Bolivia.
Don: Oh Bill, it must be hard to lose a relative.
W. C.: It's almost impossible.
-- W. C. Fields, from "The Further Adventures of Larson
E. Whipsnade and other Tarradiddles"

Jul 19 '05 #6

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

Similar topics

2
by: Tim Fountain | last post by:
We've recently enabled slow query logging on a server and it's proving interesting seeing which queries are bogging things down. This one is puzzling me a little: SELECT articleid, type,...
0
by: Jesse Sheidlower | last post by:
I'm struggling with speed issues on some queries that I would have expected to be relatively fast. Perhaps even more frustratingly, when I've tried to break these down into their components, they...
0
by: Scott | last post by:
Hi, I'm having a problem with a new machine running Mysql version 4.0.18 on the AMD64 version of Mandrake 10.0. The new machine has got 64bit AMD processor and 2GB of RAM. Nearly all...
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...
83
by: D. Dante Lorenso | last post by:
Trying to use the 'search' in the docs section of PostgreSQL.org is extremely SLOW. Considering this is a website for a database and databases are supposed to be good for indexing content, I'd...
0
by: Pratchaya | last post by:
In my.cnf i add these lines ####### log-bin log-slow-queries = /var/log/mysqld-slow.log long_query_time=1 #######
12
by: grace | last post by:
i am wondering why my database retrieval becomes too slow...we set up a new server (ubuntu, breezy badger) machine where we transferred all our files from the old server.. Our new server uses Asus...
9
by: Derrick Shields | last post by:
I'm working with a database that has over 11 million rows. The .SQL drop file is about 2.5gigs. Doing a simple query: select * from people where last_name like '%smith%' A query like this can...
2
by: mezise | last post by:
Posted by Pratchaya: ------------------------------------------------------ MySQL Slow Log ERROR In my.cnf i add these lines ####### log-bin log-slow-queries = /var/log/mysqld-slow.log
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: 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: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
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...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...

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.