Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

mySQL - Creating databases in VB via ODBC

Posted on 2003-10-27
4
Medium Priority
?
344 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 100 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

Important Lessons on Recovering from Petya

In their most recent webinar, Skyport Systems explores ways to isolate and protect critical databases to keep the core of your company safe from harm.

Question has a verified solution.

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

Introduction While answering a recent question (http://www.experts-exchange.com/Q_27402310.html) in the VB classic zone, I wrote some VB code in the (Office) VBA environment, rather than fire up my older PC.  I didn't post completely correct code o…
If you have ever used Microsoft Word then you know that it has a good spell checker and it may have occurred to you that the ability to check spelling might be a nice piece of functionality to add to certain applications of yours. Well the code that…
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
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…
Suggested Courses

722 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