?
Solved

MySQL - API (mySqlLib.dll)

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

Accepted Solution

by:
eAi2k earned 80 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: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering 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

The debugging module of the VB 6 IDE can be accessed by way of the Debug menu item. That menu item can normally be found in the IDE's main menu line as shown in this picture.   There is also a companion Debug Toolbar that looks like the followin…
Background What I'm presenting in this article is the result of 2 conditions in my work area: We have a SQL Server production environment but no development or test environment; andWe have an MS Access front end using tables in SQL Server but we a…
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…
Suggested Courses
Course of the Month14 days, 15 hours left to enroll

839 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