cedricloffer
Messages postés6Date d'inscriptionlundi 18 juin 2007StatutMembreDernière intervention25 décembre 2009
-
24 déc. 2009 à 07:18
Calade
Messages postés1207Date d'inscriptiondimanche 20 avril 2003StatutMembreDernière intervention 4 juin 2016
-
26 déc. 2009 à 09:03
Bonjour à tous,
je suis en train de modifier un projet Visual Basic (.net 2008) de manière à désormais travailler avec une base de données FIREBIRD.
Au préalable, ma "fonction" me permettait, par un paramètre stocké dans un fichier ini de sélectionner une base ACCESS ou SQL2000.
Voici la fonction que j'utilise en ADO :
Public Function ConnexionBDDSql2000(ByVal Nomconnection As ADODB.Connection, ByVal utilisateur As String, ByVal password As String, ByVal serveur As String, ByVal base As String) As Boolean
Const Provider As String = "SQLOLEDB.1"
Try
With Nomconnection
.Provider = Provider
.ConnectionString = "Persist Security Info=False;User ID=" & utilisateur & ";Password=" & password & ";Initial Catalog=" & base & ";Data Source=" & serveur & ""
.ConnectionTimeout = 6
.CommandTimeout = 60
.Open()
End With
Catch ex As Exception
MsgBox("Erreur ConnexionBDDSql: " & ex.ToString)
Return (False)
Exit Function
End Try
Return (True)
End Function
Public Function ConnexionBDDAccess2003(ByVal Nomconnection As ADODB.Connection, ByVal adresse As String, ByVal password As String) As Boolean
Const Provider As String = "Microsoft.Jet.OLEDB.4.0"
Try
With Nomconnection
.Provider = Provider
.ConnectionString = "Data Source=" & adresse & ";Jet OLEDB:Database Password=" & password
.ConnectionTimeout = 6
.CommandTimeout = 60
.Open()
End With
Catch ex As Exception
MsgBox("Erreur ConnexionBDDAccess: " & ex.ToString)
Return (False)
Exit Function
End Try
Return (True)
End Function
Quelqu'un peut il m'aider à transposer cette fonction vers FIREBIRD ?
Dois je télécharger en complément un nouveau driver???
cedricloffer
Messages postés6Date d'inscriptionlundi 18 juin 2007StatutMembreDernière intervention25 décembre 2009 25 déc. 2009 à 11:04
Merci pour cette réponse, mais je ne m'en sors pas...
De plus, je cherche à travailler avec des outils gratuits, c'est pour cette raison que je me suis orienté vers FIREBIRD.
Pouvez vous encore m'aider svp???
Un exemple de code serait bienvenu :-)