Go Premium for a chance to win a PS4. Enter to Win

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 349
  • Last Modified:

mySQL - Creating databases in VB via ODBC

Can someone give me an example of how to create a database via odbc in visual basic using mySQL?  This would help.
0
clear100-com
Asked:
clear100-com
  • 2
  • 2
1 Solution
 
mquirozCommented:
Using Microsoft Activex Data Objects and MyODBC 3.51 (from www.mysql.com) the code looks like this:

'code begins here
dim  cnn as adodb.connection
set cnn = new adodb.connection

cnn.open "server=yourserver;db=yorudb;driver=MySQL ODBC 3.51 Driver;uid=root;pwd=xxx"

cnn.execute "CREATE DATABASE YOURNEWDB"

cnn.close

set cnn = nothing
'code ends here
0
 
clear100-comAuthor Commented:
do you have the link where you got that?
I will test your stuff soon, thank you so much for your help, i wish i had more points to give to you.
0
 
clear100-comAuthor Commented:
Thanks again!
0
 
mquirozCommented:
Not any specific link, I have several vb apps with  mysql as db...
0

Featured Post

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

  • 2
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now