473,547 Members | 2,532 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

How to connect MySQL database to VB2005 at design time?

nev
251 Contributor
Can anyone tell me the steps how to do this or direct me to a link? I connect MySQL during runtime. I was wondering if its possible during design time so that I can use the IDE to manage all my MySQL tables.
Oct 18 '07 #1
7 4907
Dököll
2,364 Recognized Expert Top Contributor
Can anyone tell me the steps how to do this or direct me to a link? I connect MySQL during runtime. I was wondering if its possible during design time so that I can use the IDE to manage all my MySQL tables.
Hiya, Nev!

It's likely you have tried this already, but there are some amazing videos I've seen with examples on connecting to SQL Server, might be able to mix it up to make it do what you need for MySQL:

http://msdn2.microsoft.com/en-us/express/aa718409.aspx

If this does not work for you, please stay tuned!

Also, Welcome!

Dököll
Oct 18 '07 #2
nev
251 Contributor
Hiya, Nev!

It's likely you have tried this already, but there are some amazing videos I've seen with examples on connecting to SQL Server, might be able to mix it up to make it do what you need for MySQL:

http://msdn2.microsoft.com/en-us/express/aa718409.aspx

If this does not work for you, please stay tuned!

Also, Welcome!

Dököll
Thank you! I'll check out the link.
Oct 18 '07 #3
nev
251 Contributor
Hi dokoll, I checked out the link but it only talks of Microsoft's SQL Server. This can be done because when I click the 'Add Datasource', I can select SQL Server from the list. For MySQL however, it doesn't appear in the list that's why I can't select it. How will I 'Add Datasource' MySQL database using the IDE so that I can use for example the Query Designer?
Oct 18 '07 #4
thelner
13 New Member
Hey nev,

I just started learning vb.net and mysql today and this site is really helping me a lot. They have an artice on vb.net and mysql.
Oct 18 '07 #5
nev
251 Contributor
Hey nev,

I just started learning vb.net and mysql today and this site is really helping me a lot. They have an artice on vb.net and mysql.
thaksn for the input.
Jan 28 '08 #6
WinblowsME
58 New Member
Download MySQL Connector Net 5.0.8.1

Start a new project and add a reference to Microsoft Active Data Objects 2.x.
Project -> Add Reference -> COM tab -> Microsoft Active Data Objects 2.x

Modify the code to suit your needs.

Expand|Select|Wrap|Line Numbers
  1. Public Class Form1
  2.     Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
  3.         Dim conn As New ADODB.Connection
  4.         Dim rs As New ADODB.Recordset
  5.         Dim mysql_server As String = "localhost"
  6.         Dim db As String = "database_name"
  7.         Dim user As String = "user_name"
  8.         Dim pass As String = "password"
  9.         Dim sql As String
  10.         Dim fields As Array
  11.         Dim i As Integer
  12.  
  13.         Try
  14.             conn.ConnectionString = "Driver={MySQL ODBC 3.51 Driver};Server=" & mysql_server & ";Database=" & db & ";User=" & user & ";Password=" & pass & ";Option=3;"
  15.             conn.Open()
  16.  
  17.             sql = "SELECT FirstName, LastName FROM tbladdresses ORDER BY FirstName;"
  18.             rs.Open(sql, conn, ADODB.CursorTypeEnum.adOpenKeyset, ADODB.LockTypeEnum.adLockOptimistic)
  19.  
  20.             fields = rs.GetRows
  21.             rs.Close()
  22.         Catch ex As Exception
  23.             MsgBox("Connection string is incorrect.")
  24.             Exit Sub
  25.         End Try
  26.  
  27.         For i = 0 To UBound(fields, 2)
  28.             Debug.Print(fields(1, i))
  29.         Next
  30.  
  31.         conn.Close()
  32.     End Sub
  33. End Class
  34.  
Jan 28 '08 #7
WinblowsME
58 New Member
Sorry, I misunderstood the question with my previous post. Why not download the QueryBrowser?

http://www.mysql.com/products/tools/query-browser/
Jan 28 '08 #8

Sign in to post your reply or Sign up for a free account.

Similar topics

6
6473
by: Eric W. Holzapfel | last post by:
Hello PHP group, I have mysql running on a linux box. I have apache (2.0.4) running on a diff linux box. I have php 4.X. I can connect to the mysql db using odbc from a windows box, but cannot connect to the remote db from web server box (linux) to mysql database (another linux box). Apache is on RH Enterprise 3.0, mysql is on slacware...
1
2537
by: Cern | last post by:
Is it somebody out there who has made a migration from an Oracle server to an MySQL server?? The scenario is as simply: I've got a Oracle 8 server with a database with content that I want to transfer to a MySQL database. No special data, constraints etc that MySQL not will handle. My solution is to reverse engineer the database from...
1
1902
by: malcolm | last post by:
Hello, We use several user controls and derived custom controls. Some of which actually hit the database at design time to show data (such as filling a list box, etc...) Our c# client server app uses the .NET Isolated storage libraries for storing connection string and other info about the application. The problem is that the Isolated...
14
6075
by: mistral | last post by:
Need php script to create mySQL database programmatically; since hosting configuration may not allow create database from script, script also need eliminate/rewrite all restrictions in appropriate places in that hosting.
2
2248
by: basestring | last post by:
Hi I am busy now for many hours without luck I have a database and when I use PHP to add date to it, it works only one time when i want to add the next data, It doesn't work. but i don't get any errors??? see my code: $query = "INSERT INTO products VALUES ...
8
4627
by: menmysql | last post by:
i am not bale to solve this problem since two weeks i am trying to access records from mysql database using jsp. inside this jsp program i wrote all my JDBC code. it is working very nicely and displaying records. now i wrote all the JDBC code in .java and i am accessing that code in jsp file. but this time i am getting only exceptions not...
3
7365
by: likigoldenstar | last post by:
Hi, I have some problem in developing program using PHP. I 'll explain my platforms: I use appserv-win32-2.5.9 as a app server. In the server, mysql client version is 5.0.37 Problems:
39
5830
by: alex | last post by:
I've converted a latin1 database I have to utf8. The process has been: # mysqldump -u root -p --default-character-set=latin1 -c --insert-ignore --skip-set-charset mydb mydb.sql # iconv -f ISO-8859-1 -t UTF-8 mydb.sql mydb_utf8.sql mysqlCREATE DATABASE mydb_utf8 CHARACTER SET utf8 COLLATE utf8_general_ci;
2
1635
by: vaishalinagare | last post by:
when i try to connect mysql database with vb 6.0 i got error Data source name not found and no default driver specified. i'm trying to connect remote database.
0
7510
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main...
0
7703
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. ...
0
7947
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that...
1
7463
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For...
0
6032
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then...
1
5362
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes...
0
5081
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert...
0
3493
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in...
1
1050
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.