Solved

MySQL - API (mySqlLib.dll)

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

Courses: Start Training Online With Pros, Today

Brush up on the basics or master the advanced techniques required to earn essential industry certifications, with Courses. Enroll in a course and start learning today. Training topics range from Android App Dev to the Xen Virtualization Platform.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Excel VBA combine two working workbooks 8 53
MsgBox 2 54
Copy a row 12 61
Excel Automation VBA 19 67
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…
When designing a form there are several BorderStyles to choose from, all of which can be classified as either 'Fixed' or 'Sizable' and I'd guess that 'Fixed Single' or one of the other fixed types is the most popular choice. I assume it's the most p…
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…

786 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