Здрасте!
Подскажите, как можно работать с MySQL Server'ом (подключение, выполнение запросов и т. д.)? Какую библиотеку/контрол юзать?
Заранее спасибо!
Antonariy писал(а):А разве для него нет ODBC-драйвера?
Public Declare Function mysql_init Lib "libmySQL" (ByVal lMYSQL As Integer) As Integer
Public Declare Function mysql_real_connect Lib "libmySQL" (ByVal lMYSQL As Integer, ByVal sHostName As String, ByVal sUserName As String, ByVal sPassword As String, ByVal sDbName As String, ByVal lPortNum As Integer, ByVal sSocketName As String, ByVal lFlags As Integer) As Integer
Public Declare Function mysql_query Lib "libmySQL" (ByVal lMYSQL As Integer, ByVal Query As String) As Long
Public Declare Function mysql_store_result Lib "libmysql.dll" (ByVal lMYSQL As Integer) As Long
Public Declare Sub mysql_close Lib "libmysql.dll" (ByVal ms As Long)
Private Sub Form_load()
Dim mlMYSQL As Integer
mlMYSQL = mysql_init(mlMYSQL)
If mlMYSQL = 0 Then
MsgBox (" no connection handler")
End If
If mysql_real_connect(mlMYSQL, "localhost", "root", "0", "test", "3306", "", 0) = 0 Then
MsgBox ("во блин !")
Else '
Dim s As String
s = "SELECT * FROM `main` WHERE 1"
Console.WriteLine (mysql_query(mlMYSQL, s))
Console.WriteLine (mysql_store_result(mlMYSQL))
End If
Console.Read
End Sub
Через компоненты и References не добавляется.
Сейчас этот форум просматривают: Yandex-бот и гости: 87