Nevar pievienot vairāk kā 25 tēmas Tēmai ir jāsākas ar burtu vai ciparu, tā var saturēt domu zīmes ('-') un var būt līdz 35 simboliem gara.

pirms 8 mēnešiem
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.