25개 이상의 토픽을 선택하실 수 없습니다. Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

lib.DAL.asp 1.5KB

8 달 전
1234567891011121314151617181920212223242526272829
  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.mdb;"
  23. End If
  24. set DAL = DAL__Singleton
  25. End Function
  26. %>

Powered by TurnKey Linux.