Solved

MySQL - API (mySqlLib.dll)

Posted on 2004-05-01
4
891 Views
Last Modified: 2007-12-19
Hello, How can you make tables with this api?  
0
Comment
Question by:dawnyd01
  • 2
4 Comments
 
LVL 1

Accepted Solution

by:
eAi2k earned 20 total points
ID: 10971315
I've never used this dll, but you can use ADODB to create tables:

I assume you've got MyODBC set up and a DSN, if so, then the code you require in VB is somthing like this:

  Set conntemp = CreateObject("adodb.connection")  
  conntemp.Open "DSN=[YOUR DSN NAME HERE]" ' connect

  mySQL = "Create table [table name here]"
  conntemp.Execute mySQL   ' execute the code

  set conntemp = Nothing

See http://dev.mysql.com/doc/mysql/en/CREATE_TABLE.html for more advanced create syntax (such as adding fields etc)

eAi
0
 

Author Comment

by:dawnyd01
ID: 10971941
The whole reasion for the dll is not to have anything to do with myODBC or ODBC and dsn's.
0
 

Author Comment

by:dawnyd01
ID: 10981801
Found out how by just playing around with it....  check it out, it works great...

Dim mysql_options As Long
Set mysql = New cMysql
mysql.real_connect txtHost, txtUser, txtPass, txtDB, CLng(txtPort), , 0
mysql.query "CREATE TABLE people5(name varchar(50), email varchar(50))"
Set mysql = Nothing
If mrec Is Nothing Then Else mrec.Close
Set mrec = Nothing

sys admin, please do not delete this question, just refund points so people can learn from this.

Thanks.
0

Featured Post

What Security Threats Are You Missing?

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

Join & Write a Comment

Introduction In a recent article (http://www.experts-exchange.com/A_7811-A-Better-Concatenate-Function.html) for the Excel community, I showed an improved version of the Excel Concatenate() function.  While writing that article I realized that no o…
Introduction While answering a recent question about filtering a custom class collection, I realized that this could be accomplished with very little code by using the ScriptControl (SC) library.  This article will introduce you to the SC library a…
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…

747 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

12 Experts available now in Live!

Get 1:1 Help Now