Beginner Programming
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsOtherBeginner Programming

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
  #1  
Old March 14th, 2003, 11:03 AM
chris2003 chris2003 is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Mar 2003
Posts: 6 chris2003 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 47 m 7 sec
Reputation Power: 0
Question Need help with MySQL and VB !

Hello,

I'm developing a database using MySQL(v 4.0.4 beta-max-nt) as my database server and a vb(VB6) application as the client. On my client application, I have developed a class module that performs all the SQL calls to MySQL.
The database has 7 tables. One of my tables has about 15000 records.
My problem is that when I execute a query to this specific table, it takes about 10 seconds to get the result. It is way too long and I have no idea of what is the problem.

Does somebody can tell me what is wrong or what I'm doing wrong??

Here is what I have on my class module using ADO which makes the SQL call

Private Sub Class_Initialize()
Set cnCommercial = New ADODB.Connection
cnCommercial.Provider = "MSDataShape"
cnCommercial.ConnectionString= "DSN=myODBC;UID=*****;PWD=*******; "
End Sub

Private Sub Class_Terminate()
Set cnCommercial = Nothing
End Sub

Public Function Get_Table_Recordset(strTable As String) As ADODB.Recordset
cnCommercial.Open
cnCommercial.CursorLocation = adUseClient
strSQL = "SELECT * FROM " & strTable
Set Get_Table_Recordset = cnCommercial.Execute(strSQL)
Get_Table_Recordset.ActiveConnection = Nothing
cnCommercial.Close
End Function

Reply With Quote
  #2  
Old March 14th, 2003, 12:47 PM
Onslaught's Avatar
Onslaught Onslaught is offline
/(bb|[^b]{2})/
Dev Shed Demi-God (4500 - 4999 posts)
 
Join Date: Nov 2001
Location: Somewhere in the great unknown
Posts: 4,840 Onslaught User rank is Second Lieutenant (5000 - 10000 Reputation Level)Onslaught User rank is Second Lieutenant (5000 - 10000 Reputation Level)Onslaught User rank is Second Lieutenant (5000 - 10000 Reputation Level)Onslaught User rank is Second Lieutenant (5000 - 10000 Reputation Level)Onslaught User rank is Second Lieutenant (5000 - 10000 Reputation Level)Onslaught User rank is Second Lieutenant (5000 - 10000 Reputation Level)Onslaught User rank is Second Lieutenant (5000 - 10000 Reputation Level) 
Time spent in forums: 2 Days 36 m 16 sec
Reputation Power: 88
Send a message via ICQ to Onslaught
have you tried this same command from the mysql command line?
You could also try and put an index on the table which would speed up retrieval also.

Reply With Quote
Reply

Viewing: Dev Shed ForumsOtherBeginner Programming > Need help with MySQL and VB !


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 5 hosted by Hostway
Stay green...Green IT