Solved

mySQL - Creating databases in VB via ODBC

Posted on 2003-10-27
4
328 Views
Last Modified: 2010-05-01
Can someone give me an example of how to create a database via odbc in visual basic using mySQL?  This would help.
0
Comment
Question by:clear100-com
  • 2
  • 2
4 Comments
 
LVL 7

Accepted Solution

by:
mquiroz earned 25 total points
ID: 9628055
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
 

Author Comment

by:clear100-com
ID: 9628573
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
 

Author Comment

by:clear100-com
ID: 9628712
Thanks again!
0
 
LVL 7

Expert Comment

by:mquiroz
ID: 9629472
Not any specific link, I have several vb apps with  mysql as db...
0

Featured Post

Live: Real-Time Solutions, Start Here

Receive instant 1:1 support from technology experts, using our real-time conversation and whiteboard interface. Your first 5 minutes are always free.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

I’ve seen a number of people looking for examples of how to access web services from VB6.  I’ve been using a test harness I built in VB6 (using many resources I found online) that I use for small projects to work out how to communicate with web serv…
When designing a form there are several BorderStyles to choose from, all of which can be classified as either 'Fixed' or 'Sizable' and I'd guess that 'Fixed Single' or one of the other fixed types is the most popular choice. I assume it's the most p…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…

786 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question