Hola tengo un problema para conectar a mysql o sql server con asp, el primero code co con sql server:
Código:
<%option explicit%>
<html>
<head>
<title>problema</title>
</head>
<body>
<%
dim conexion
set conexion = Server.CreateObject("ADODB.Connection")
conexion.ConnectionString = "Provider=SQLOLEDB.1;" & _
"Data Source=.;" & _
"Integrated Security=SSPI;" & _
"Persist Security Info=False;" & _
"Initial Catalog=pruebas"
conexion.Open
dim registros
set registros = Server.CreateObject("ADODB.RecordSet")
registros.open "select producto from productos",conexion
do while not registros.eof
response.write("Código:" & registros("producto"))
registros.movenext
loop
conexion.close
%>
</body>
</html>
me da el error:
Microsoft OLE DB Provider for SQL Server error '80040e4d'
Login failed for user 'NT AUTHORITY\IUSR'.
/list.asp, l�nea 15
Y el segundo con mysql:
Código:
<%
dim conn
dim conn_string
conn_string = "Driver={MySQL};Server=127.0.0.1;Port=3306;Database=pruebas;Uid=root;Pwd=placabase"
Set conn = Server.CreateObject("ADODB.Connection")
conn.Open(conn_string)
strQuery = "SELECT * FROM productos"
Set RS = conn.Execute(strQuery)
%>
<html>
<body>
<b>Resultados</b>
<br><br>
<%while not RS.eof%>
<%=RS("producto")%> <%=RS("precio")%><br>
<%RS.MoveNext%>
<%wend%>
</body>
</html>
me da:
Microsoft OLE DB Provider for ODBC Drivers error '80004005'
[Microsoft][Administrador de controladores ODBC] No se encuentra el nombre del origen de datos y no se especificó ningún controlador predeterminado
/mysql.asp, línea 9
Cual es mi pronlema :(