Ver Mensaje Individual
  #3 (permalink)  
Antiguo 01/07/2002, 12:55
Avatar de DARIOI
DARIOI
 
Fecha de Ingreso: mayo-2001
Ubicación: Gotland-Visvy
Mensajes: 181
Antigüedad: 24 años
Puntos: 0
Re: Conexsión SQL

hola. flush es un metodo del response contrario a la propiedad buffer del response. osea plush envia inmediatamente la salida de memoria al cliente contrario a buffer que la envia a memoria antes del cliente.
ahora con respecto a la conexion a sql usa esta la mas facil y compresible de todas.
<%
Dim strSQLServerName nombre o ip de tu sql Server xxx.xxx.zz.v
Dim strSQLDBUserName nombre para SQL Server Authentication) osea sa si no te dieron un nombre de usuario para la base de datos
Dim strSQLDBPassword password para (for SQL Server Authentication) osea deja en blanco si no te protegienron con contraseña
Dim strSQLDBName nombre de la base de datos sobre el servidor sql osea mi base de datos sin extension debe estar creada
strSQLServerName = ""
strSQLDBUserName = ""
strSQLDBPassword = ""
strSQLDBName = "mibase"
'SQL Server OLE Driver
strCon = "Provider=SQLOLEDB;Server=" & strSQLServerName & ";User ID=" & strSQLDBUserName & ";Password=" & strSQLDBPassword & ";Database=" & strSQLDBName & ";"
%>

<%
Dim adoCon 'Database Connection Variable
Dim strCon 'Holds the Database driver and the path and name of the database
Dim strSQL 'Holds the SQL query for the database
Dim intBadWordLoopCounter 'Holds the bad word filter writing to db counter
Dim blnErrorOccured 'Set to true if an error occurs
'Resume on all errors
On Error Resume Next
'intialise variables
blnErrorOccured = False
'If a username and password is entred then start the ball rolling
If NOT Request.Form("name") = "" Then
'Create database connection
'Create a connection odject
Set adoCon = Server.CreateObject("ADODB.Connection")
'Build a database driver connection string to the SQL server
strCon = "Provider=SQLOLEDB;Server=" & strSQLServerName & ";User ID=" & Request.Form("name") & ";Password=" & Request.Form("password") & ";Database=" & strSQLDBName & ";"
'Set an active connection to the Connection object
adoCon.Open strCon
'If an error has occured writ