예제 #1
0
        public bool connexion(string nomLien, string nomBase, string login, string motDePasse, connectionProperties.TYPE_ODBC type)
        {
            string chaineConnexion = (type == connectionProperties.TYPE_ODBC.FICHIER ? "filedsn" : "dsn=") + nomLien;

            if (!string.IsNullOrEmpty(nomBase))
            {
                chaineConnexion += ";database=" + nomBase;
            }
            if (!string.IsNullOrEmpty(login))
            {
                chaineConnexion += ";uid=" + login;
            }
            if (!string.IsNullOrEmpty(motDePasse))
            {
                chaineConnexion += ";pwd='" + motDePasse + "'";
            }
            return(connect(chaineConnexion));
        }
예제 #2
0
 public bool connexion(string nomLien, connectionProperties.TYPE_ODBC type)
 {
     return(connexion(nomLien, "", "", "", type));
 }