Du kannst nicht mehr als 25 Themen auswählen Themen müssen entweder mit einem Buchstaben oder einer Ziffer beginnen. Sie können Bindestriche („-“) enthalten und bis zu 35 Zeichen lang sein.

29 Zeilen
1.6KB

  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 "Provider=Microsoft.Jet.OLEDB.4.0;Jet OLEDB:Engine Type=5;Data Source=" & Request.ServerVariables("APPL_PHYSICAL_PATH") & "Data\webdata - Copy.mdb;"
  23. 'DAL__Singleton.Initialize "Provider=SQLOLEDB;Server=danielsubuntu,15789;Database=tracking;UID=sa;PWD=SunBrightShine!;"
  24. End If
  25. set DAL = DAL__Singleton
  26. End Function
  27. %>

Powered by TurnKey Linux.