SQL SERVER connection string for classic asp

0

How do I create a connection string for classic ASP to connect to the Microsoft SQL Server database

    
asked by anonymous 15.04.2014 / 20:17

1 answer

6
Whenever I needed to use these connections strings, depending on your SQL SERVER and the providers installed on the application machine, you can make use of any Native Client to connect to a version of SQL SERVER greater than or equal to version of your native client.

Native Client : The native client is a specific library to optimize the connection to SQL SERVER and allows you to work with persistence and data capture with all the features that SQL SERVER native) allows (Ex: Data types and new queries etc ...).

Source: link

Set oBanco = Server.CreateObject("ADODB.Connection")

SQL SERVER 2012:

oBanco.Open "Provider=SQLNCLI11;Server=IPSERVIDOR;Database=BASEDEDADOS;Uid=USUARIO;Pwd=SENHA;"

SQL SERVER 2008:

oBanco.Open "Provider=SQLNCLI10;Server=IPSERVIDOR;Database=BASEDEDADOS;Uid=USUARIO;Pwd=SENHA;"

SQL SERVER 2005

oBanco.Open "Provider=SQLNCLI;Server=IPSERVIDOR;Database=BASEDEDADOS;Uid=USUARIO;Pwd=SENHA;"

SQL SERVER ( Everyone with non-native access )

oBanco.Open "Provider=sqloledb;Data Source=IPSERVIDOR;Initial Catalog=BASEDEDADOS;User ID=USUARIO;Password=SENHA;"
    
15.04.2014 / 21:22