ISAM driver not found VBA Access
medbo
Posted messages
570
Status
Member
-
medbo Posted messages 570 Status Member -
medbo Posted messages 570 Status Member -
Hello,
I am developing a small Access database application that needs to connect to a MySQL database and link the tables it contains.
However, when executing the VBA code, I get a message saying (ISAM driver not found).
What does this mean? And how can I solve this problem?
Thank you for your help.
Configuration: Linux / Firefox 26.0
--
It is by helping each other that we will succeed.
I am developing a small Access database application that needs to connect to a MySQL database and link the tables it contains.
However, when executing the VBA code, I get a message saying (ISAM driver not found).
What does this mean? And how can I solve this problem?
Thank you for your help.
Configuration: Linux / Firefox 26.0
--
It is by helping each other that we will succeed.
1 answer
-
Pour vous éclairer, voici le code que j'utilise :
1- dans un module :
Public conx As ADODB.Connection
Public servdb As String
Public nomdb As String
Public logindb As String
Public pwddb As String
Public optdb As Integer
2- à l'ouverture du formulaire "menu" pour établir la connexion à la base de donnée MYSQL :
Private Sub Form_Open(Cancel As Integer)
servdb = "localhost"
nomdb = "BD"
logindb = "User"
pwddb = "pwd"
optdb = "3"
Set conx = New ADODB.Connection
On Error GoTo erreur1
conx.CursorLocation = adUseServer
conx.Open "DRIVER={MySQL ODBC 3.51 Driver};SERVER=" & servdb & ";DATABASE=" & nomdb & ";USER=" & logindb & ";PASSWORD=" & pwddb & ";OPTION=" & optdb & ""
Exit Sub
erreur1:
MsgBox ("Impossible de contacter le serveur")
End Sub
3- en cliquant sur le bouton "LIER" pour lier la table "TABLE" qui se trouve dans la base "BD" dans MYSQL :
Private Sub Commande0_Click()
Dim tdfLinked As TableDef
' Ouvre la base de données courante.
Set dbsCurrent = CurrentDb
' Crée une table liée pointant vers une base de données ODBC.
Set tdfLinked = dbsCurrent.CreateTableDef("TABLE")
tdfLinked.Connect = "DRIVER={MySQL ODBC 3.51 Driver};SERVER=localhost;DATABASE=BD;USER=User;PASSWORD=pwd;OPTION=3"
tdfLinked.SourceTableName = "TABLE"
'Lie la table
dbsCurrent.TableDefs.Append tdfLinked
'Rafraîchit les données
tdfLinked.RefreshLink
End Sub
là il y a le message (Pilote ISAM introuvable) qui s'affiche et la ligne (dbsCurrent.TableDefs.Append tdfLinked) est marquée en jaune dans le mode débogage VBA
Merci pour l'aide