Solved

mySQL - Creating databases in VB via ODBC

Posted on 2003-10-27
4
325 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
Comment Utility
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
Comment Utility
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
Comment Utility
Thanks again!
0
 
LVL 7

Expert Comment

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

Featured Post

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

Background What I'm presenting in this article is the result of 2 conditions in my work area: We have a SQL Server production environment but no development or test environment; andWe have an MS Access front end using tables in SQL Server but we a…
If you need to start windows update installation remotely or as a scheduled task you will find this very helpful.
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…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…

728 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

Need Help in Real-Time?

Connect with top rated Experts

13 Experts available now in Live!

Get 1:1 Help Now