Consolidated ASP Classic MVC framework from best components
Vous ne pouvez pas sélectionner plus de 25 sujets Les noms de sujets doivent commencer par une lettre ou un nombre, peuvent contenir des tirets ('-') et peuvent comporter jusqu'à 35 caractères.

29 lignes
1.3KB

  1. <%
  2. ' This class encapsulates database access into one location, isolating database details from the rest of the app.
  3. ' Multiple databases can be handled in one of two ways:
  4. '
  5. ' Option 1. Use a single DAL_Class instance with separate public properties for each database.
  6. ' Ex: To access Orders use DAL.Orders and to access Employees use DAL.Employees.
  7. '
  8. ' Option 2. Use a separate DAL_Class instance for each database.
  9. ' Ex:
  10. ' dim OrdersDAL : set OrdersDAL = new DAL_Class
  11. ' OrdersDAL.ConnectionString = "..." <-- you would have to create this property to use this approach
  12. '
  13. ' If you only access one database it is easier to just set the global DAL singleton to an instance of the
  14. ' Database_Class and use it directly. See the example project for details.
  15. '=======================================================================================================================
  16. ' DATA ACCESS LAYER Class
  17. '=======================================================================================================================
  18. dim DAL__Singleton : set DAL__Singleton = Nothing
  19. Function DAL()
  20. If DAL__Singleton is Nothing then
  21. set DAL__Singleton = new Database_Class
  22. DAL__Singleton.Initialize GetAppSetting("ConnectionString")
  23. End If
  24. set DAL = DAL__Singleton
  25. End Function
  26. %>

Powered by TurnKey Linux.