FRIHOST FORUMS SEARCH FAQ TOS BLOGS COMPETITIONS
You are invited to Log in or Register a free Frihost Account!


MySQL in Visual Basic?





Diablosblizz
Hey, I have searched everywhere, and no site will explain to me how to get Visual Basic to connect to MySQL? There isn't any components, from what I can see.

Can somebody please explain to me how I can select and insert text from/into my database on my server?

Thank you very much!
filet
Google my friend is a great resource. Here try this:
http://www.google.com.my/search?hl=en&q=connect+mysql+with+visual+basic&btnG=Google+Search&meta=
ThePolemistis
Diablosblizz wrote:
Hey, I have searched everywhere, and no site will explain to me how to get Visual Basic to connect to MySQL? There isn't any components, from what I can see.

Can somebody please explain to me how I can select and insert text from/into my database on my server?

Thank you very much!


what version of VB? .net or 6?
w0wsabaw
Use ADO

Code:

Public cn As New ADODB.Connection
Public rs As New ADODB.Recordset

cn.Open "DRIVER={MySQL ODBC 3.51 Driver};Server=" & server & ";UID=" & user & ";PWD=" & Password & ";Database=" & Database


hope that would help you.[/code]
jsfdan
Thanks, I've been looking all over for this too!
albuferque
You need to install MySQL ODBC:
http://dev.mysql.com/downloads/connector/odbc/5.1.html#win32

Then use one of these connection strings:

Local database
Driver={MySQL ODBC 5.1 Driver};Server=localhost;Database=myDataBase; User=myUsername;Password=myPassword;Option=3;


Remote database
Driver={MySQL ODBC 5.1 Driver};Server=data.domain.com;Database=myDataBase;User=myUsername; Password=myPassword;Option=3;


Specifying TCP/IP port
Driver={MySQL ODBC 5.1 Driver};Server=data.domain.com;Port=3306;Database=myDataBase;User=myUsername; Password=myPassword;Option=3;

The driver defaults to port value 3306, if not specified in the connection string, as 3306 is the default port for MySQL.

Specifying character set
Driver={MySQL ODBC 5.1 Driver};Server=data.domain.com;charset=UTF8;Database=myDataBase;User=myUsername; Password=myPassword;Option=3;
4yourself
are the 3306 for all domains?
what 4041 or 4040 or 4334?!!!!!
albuferque
I guess 4040 and 4042 ports are used for Mysql-proxy.
Related topics
Microsoft Visual Basic help
C#,Visual Basic.NET,Visual Studio.NET Videos
visual basic.net
MS Visual Basic Studio 2005 Express Edition
Visual Basic Tutorial - File I/O in VB: Text Files
Visual Basic Tutorial - Control Arrays: What, Why and How
Visual Basic Tutorial - Looping
Visual Basic Express Addition
Visual Basic programming tutorial
graphic programming in visual basic
how to use winsock in visual basic????????
how to create a simple chat using winsock in visual basic???
GD and Visual Basic... Is it possible?
Visual Basic RUles
Reply to topic    Frihost Forum Index -> Scripting -> Others

FRIHOST HOME | FAQ | TOS | ABOUT US | CONTACT US | SITE MAP
© 2005-2011 Frihost, forums powered by phpBB.