-
April 22nd, 2010, 10:25 PM
#1
Connection VB6 to Server Mysql Very Slow
Please information, I created a projects by VB6 and Database MySql. When I connection to server local (127.0.0.1) courses walked smoothly and quick once, however when Database existing in Server or another computer with connections IP courses running but when open connections ages 10-20 seconds.
please enlightenment. my connection like this:
Set strCon = New ADODB.Connection
Dim StrString As String
Dim ser, user, pass, db, soc, pro As String
ser = "10.0.0.1" 'ip komputer server
db = "mydb"
user = "myuser"
pass = "mypass"
soc = "UTF8"
pro = "UNIX"
StrString = "DRIVER={MySQL ODBC 5.1 Driver};SERVER= " & ser & ";DATABASE=" & db & ";UID=" & user & ";PWD=" & pass & ";Protocol=" & pro & ";port=3306; OPTION=2105"
strCon.Open StrString
strCon.CursorLocati on = adUseClient
Please help.?
-
April 22nd, 2010, 10:43 PM
#2
Re: Connection VB6 to Server Mysql Very Slow
I doubt that it is causing that big of a deal but the way you have defined your variables is not good.
ser, user, pass, db, soc will all be defined as variant and only pro will be defined as string. In general this is slower and wastes memory space but again I doubt it is causing a huge issue.
Some times the useclient cursor setting can slow you down
other than that it looks ok to me.
Always use [code][/code] tags when posting code.
-
April 23rd, 2010, 05:46 AM
#3
Re: Connection VB6 to Server Mysql Very Slow
Usually slow connections to MySQL have to do with name resolution.
Try changing the my.cnf file on the server (linux) or my.ini (if windows) and add this line.
--skip-name-resolve
Then restart the server. Without that switch, when someone connects, the server tries to do a reverse lookup of the IP address you are connecting from. If your DNS is not set up properly, your connection times may be seconds instead of immediately.
-
April 27th, 2010, 12:35 AM
#4
Re: Connection VB6 to Server Mysql Very Slow
Please information, I created a projects by VB6 and Database MySql. When I connection to server local (127.0.0.1) courses walked smoothly and quick once, however when Database existing in Server or another computer with connections IP courses running but when open connections ages 10-20 seconds.
please enlightenment. my connection like this:
Set strCon = New ADODB.Connection
Dim StrString As String
Dim ser, user, pass, db, soc, pro As String
ser = "10.0.0.1" 'ip komputer server
db = "mydb"
user = "myuser"
pass = "mypass"
soc = "UTF8"
pro = "UNIX"
StrString = "DRIVER={MySQL ODBC 5.1 Driver};SERVER= " & ser & ";DATABASE=" & db & ";UID=" & user & ";PWD=" & pass & ";Protocol=" & pro & ";port=3306; OPTION=2105"
strCon.Open StrString
strCon.CursorLocati on = adUseClient
Please help.?
I Think.Usually slow connections to MySQL.it is due to connection string.see the following url.
Code:
http://www.connectionstrings.com/
-
April 27th, 2010, 03:55 AM
#5
Re: Connection VB6 to Server Mysql Very Slow
I used to encounter the same issue when connecting vb6 with mysql. Never really found the reason why, but I have made a work around on it. Initiating an instance of the database connection while still loading the application will eventually enhance the database access.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|