Vb.net deployment with MYSQL

khoobl

New member
Joined
Jun 25, 2005
Messages
1
Programming Experience
Beginner
I would like to create a deployment project for my application. And my application need mysql as database, my deployment package will package the mysql installation. How to use VB.net to check whether mysql had been installed in the client PC and if not install, mysql installation will be initiated before my application instalation start. Hope to get reply with tips, sample code or guide on how to do this. THANK YOU !!

Regards,
Kelly
 
I do not have it in an elegant way, but if you want to try, try something like this:

VB.NET:
[color=Blue]Dim [/color]myconstring As String
[color=Blue]Dim [/color]my_conn [color=Blue]As New[/color] Odbc.OdbcConnection

[color=Blue]Try[/color]
   [color=Green] 'Connector/ODBC 3.51 connection string[/color]
	myconstring = "DRIVER={MySQL ODBC 3.51 Driver};" & _
				   "SERVER=192.168.0.1;" & _
				 "DATABASE=DatabaseName;" & _
				   "UID=root;" & _
				   "PASSWORD=;" & _
				   "OPTION=3;"

   [color=Green] 'Connection[/color]
	 my_conn.ConnectionString = myconstring
	 my_conn.Open()

[color=Blue]Catch [/color]MyOdbcException [color=Blue]As [/color]Odbc.OdbcException
	Messagebox.Show("Database Connection Failed")
	[color=Green]'do something[/color]

[color=Blue]Catch [/color]MyException [color=Blue]As [/color]Exception
	MessageBox.Show(MyException.ToString)
[color=Blue]End Try[/color]
Just try to connect to the database. Catch OledbException, and do something if an error happens...

However, I don't think you can install MySQL in the server from the client.
 
Back
Top