You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

8 月之前
7 月之前
8 月之前
7 月之前
8 月之前
123456789101112131415161718192021222324252627282930313233
  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. if dev = true Then
  23. 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;"
  24. Else
  25. DAL__Singleton.Initialize "Provider=Microsoft.Jet.OLEDB.4.0;Jet OLEDB:Engine Type=5;Data Source=C:\inetpub\Data\webdata - Copy.mdb;"
  26. 'DAL__Singleton.Initialize "Provider=SQLOLEDB;Server=danielsubuntu,15789;Database=tracking;UID=sa;PWD=SunBrightShine!;"
  27. End If
  28. End If
  29. set DAL = DAL__Singleton
  30. End Function
  31. %>

Powered by TurnKey Linux.