Solved

MySQL - API (mySqlLib.dll)

Posted on 2004-05-01
4
905 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

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
MsgBox 2 59
to transfer string from C lanaguage to VBA 4 72
how to know if my Checkbox is True in VB6.0? 9 60
Child Form in front 4 49
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…
Since upgrading to Office 2013 or higher installing the Smart Indenter addin will fail. This article will explain how to install it so it will work regardless of the Office version installed.
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…

840 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