ASP 14
Test_sql2000.asp Guest on 7th February 2021 06:03:35 PM
  1. <%
  2. 'Se crea el objeto de la conexión
  3.  
  4. set Conex = Server.CreateObject("ADODB.Connection")
  5. 'Se especifica la ubicación de la base de datos SQL Server
  6. r
  7. Conex.ConnectionString = "Provider=SQLOLEDB.1;" & _
  8.                    "Data Source=.;" & _
  9.                    "Integrated Security=SSPI;" & _
  10.                    "Persist Security Info=False;" & _
  11.                    "Initial Catalog=testconndb"'Provider: Proveedor
  12. 'Integrated Security=SSPI: Seguridad integrada de windows
  13. 'Initial Catalog: Base de datos
  14. 'Data Source: SQL Server (. = localhost)
  15. )'Se abre la conexión y se ejecuta una consulta
  16. ta
  17. Conex.Open
  18.       set Rs = Server.CreateObject("adodb.recordset")  
  19.       set Rs = Conex.Execute("SELECT * FROM tabla")
  20.       Response.Write Rs("Campo")
  21. Conex.Clos'Se eliminan los objetos de la memoria
  22. ia
  23. Set Rs = Nothing
  24. Set Conex = Nothing

Paste is for source code and general debugging text.

Login or Register to edit, delete and keep track of your pastes and more.

Raw Paste

Login or Register to edit or fork this paste. It's free.