Connexion à SQLServer 7 en ASP

<%
' dans le global.asa
Application("Connect") = "Provider=SQLOLEDB; Data Source=(local); Initial Catalog=bd; User Id=base; Password=xxxx"

Dim MaConnection
Set MaConnection = Server.CreateObject("ADODB.Connection")
MaConnection.Open Application("Connect"),"",""

SQL = "select id from compteur order by id"
Dim MonRS
Set MonRS = Server.CreateObject("ADODB.Recordset")
MonRS.open SQL, MaConnection, adOpenForwardOnly
While not (MonRS.eof OR MonRS.Bof)
	Response.Write MonRS("id") & "<br>" & vbcrlf
	MonRS.MoveNext
Wend
MonRS.Close
Set MonRS = Nothing

MaConnection.Close
Set MaConnection = Nothing
%>


Contact
AccueilHaut de la page