Ado Driver Mysql
The following ADO ActiveX Data Objects example creates a
table my_ado and demonstrates the use of
rs.addNew, rs.delete,
and rs.update.
Private Sub myodbc_ado_Click
Dim conn As ADODB.Connection
Dim rs As ADODB.Recordset
Dim fld As ADODB.Field
Dim sql As String
connect to MySQL server using Connector/ODBC
Set conn New ADODB.Connection
conn.ConnectionString DRIVER MySQL ODBC 3.51 Driver ; _
SERVER localhost; _
DATABASE test; _
UID venu;PWD venu; OPTION 3
conn.Open
create table
conn.Execute DROP TABLE IF EXISTS my_ado
conn.Execute CREATE TABLE my_ado id int not null primary key, name varchar 20, _
txt text, dt date, tm time, ts timestamp
direct insert
conn.Execute INSERT INTO my_ado id,name,txt values 1,100, venu
conn.Execute INSERT INTO my_ado id,name,txt values 2,200, MySQL
conn.Execute INSERT INTO my_ado id,name,txt values 3,300, Delete
Set rs New ADODB.Recordset
rs.CursorLocation adUseServer
fetch the initial table. .
rs.Open SELECT FROM my_ado, conn
Debug.Print rs.RecordCount
rs.MoveFirst
Debug.Print String 50, - Initial my_ado Result Set String 50, -
For Each fld In rs.Fields
Debug.Print fld.Name,
Next
Debug.Print
Do Until rs.EOF
Debug.Print fld.Value,
rs.MoveNext
Loop
rs.Close
rs insert
rs.Open select from my_ado, conn, adOpenDynamic, adLockOptimistic
rs.AddNew
rs.Name Monty
rs.txt Insert row
rs.Update
rs update
rs.Open SELECT FROM my_ado
rs.Name update
rs.txt updated-row
rs update second time..
rs.txt updated-second-time
rs delete
rs.Delete
fetch the updated table. .
Debug.Print String 50, - Updated my_ado Result Set String 50, -
conn.Close
End Sub.
The following ADO ActiveX Data Objects example creates a table my_ado and demonstrates the use of rs.addNew, rs.delete, and rs.update.
rs.addNew, rs.delete, and rs.update
Connector/Net is a fully-managed ADO.NET driver for MySQL. Starting with version 6.7, Connector/Net will no longer include the MySQL for Visual Studio integration.
MySQL provides you with a suite of tools for developing and managing MySQL-based business critical applications on Windows. They include: MySQL Installer for Windows.
SQL Server Connection Strings SQL ODBC connection strings. Standard Security: Driver SQLServer ;Server Your_Server_Name;.
MySQL Connectors. MySQL provides standards-based drivers for JDBC, ODBC, and. Net enabling developers to build database applications in their language of choice.