1 pièce(s) jointe(s)
Connexion Excel vers database HFSL C/S
Bonjour à tous,
Nous venons de migrer notre DB de MySQL vers HFSQL. Nous avons encore un reliquat qui est un fichier Excel. Ce fichier Excel interrogeait la base MySQL, sans souci, il faut maintenant qu'il interroge la base HFSQL.
J'ai installé une source de données système (Driver ODBC pour HFSQL) qui si je ne me trompe pas ne nécessite pas la déclaration d'une analyse Windev.
J'ai du mal a trouvé la bonne syntaxe, j'en ai essayé plusieurs sans succès.
Voici mon bout de code de test :
Code:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18
| Public Sub ConnectDB()
Dim oConnect As New ADODB.Connection
Dim Pconn As String
Pconn = "DSN=HFSQL32;" & _
"Data source=IP_SERVEUR" & ";" & _
"USER ID=admin" & ";" & _
"PASSWORD=MONPASSWORD" & ";" & _
"Initial Catalog=NOM_DB" & ";"
oConnect.Open (Pconn)
If oConnect.State = adStateOpen Then
MsgBox "ok"
Else
MsgBox "ko"
End If |
Ou avec cette syntaxe :
Code:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18
| Public Sub ConnectDB()
Dim oConnect As New ADODB.Connection
Dim Pconn As String
Pconn = "DRIVER={HFSQL32};" & _
"Data source=IP_SERVEUR" & ";" & _
"USER ID=admin" & ";" & _
"PASSWORD=MONPASSWORD" & ";" & _
"Initial Catalog=NOM_DB" & ";"
oConnect.Open (Pconn)
If oConnect.State = adStateOpen Then
MsgBox "ok"
Else
MsgBox "ko"
End If |
Et j'ai toujours la même erreur :
Pièce jointe 580408
Merci de vos conseils avisés.
Cordialement,
Fred
Connexion Excel vers database HFSQL C/S
Salut,
Voici la bonne syntaxe:
Code:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22
| Public Sub ConnectDB()
Dim oConnect As New ADODB.Connection
Dim Pconn As String
Pconn = "DRIVER={HFSQL32};" & _
"Data source=HFSQL32" & ";" & _
"USER ID=admin" & ";" & _
"PASSWORD=MONPASSWORD" & ";" & _
"Initial Catalog=NOM_DB" & ";"
oConnect.Open (Pconn)
If oConnect.State = adStateOpen Then
MsgBox "ok"
Else
MsgBox "ko"
End If
End Sub |
Voila pour ceux que ça interesse.
A+