Solved

mySQL - Creating databases in VB via ODBC

Posted on 2003-10-27
4
334 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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

Instantly Create Instructional Tutorials

Contextual Guidance at the moment of need helps your employees adopt to new software or processes instantly. Boost knowledge retention and employee engagement step-by-step with one easy solution.

Question has a verified solution.

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

Suggested Solutions

Have you ever wanted to restrict the users input in a textbox to numbers, and while doing that make sure that they can't 'cheat' by pasting in non-numeric text? Of course you can do that with code you write yourself but it's tedious and error-prone …
Article by: Martin
Here are a few simple, working, games that you can use as-is or as the basis for your own games. Tic-Tac-Toe This is one of the simplest of all games.   The game allows for a choice of who goes first and keeps track of the number of wins for…
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…
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…

739 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