Ver Mensaje Individual
  #2 (permalink)  
Antiguo 10/05/2012, 09:07
Avatar de 60NZ4
60NZ4
 
Fecha de Ingreso: mayo-2012
Ubicación: 404 Not found
Mensajes: 112
Antigüedad: 12 años
Puntos: 2
Respuesta: Información sobre 1and1

mas cositas echas hoy ^^

sigo sin poder acceder a mi base de datos 1and1, en la consola la ruta del host ni me la reconoce, aqui os dejo lo que he probado para conectar con un php y con un asp

php----



<?php

$config = array();

//conexion 1and1
$config["sql_host"] = "dbxxxxxxxx.db.1and1.com";
$config["sql_user"] = "dboxxxxxxx";
$config["sql_pass"] = "XXXXXXXXX";
$config["sql_database"] = "dbxxxxxxxxx";



$conexion = mysql_connect($config['sql_host'], $config['sql_user'], $config['sql_pass']) or die(mysql_error($conexion));
mysql_select_db($config['sql_database'],$conexion) or die("No se pudo seleccionar la BD");

?>

y el asp ----


<%@ Page Language="VB" %>
<script runat="server">

Sub Page_Data
Dim oDR as System.Data.SQLClient.SQLDataReader
Dim oCom As System.Data.SQLClient.SqlCommand
Dim oConn as System.Data.SQLClient.SQLConnection
try
oConn = New System.Data.SQLClient.SQLConnection ("server=dbXXXXXXX.db.1and1.es; initial catalog=dbXXXXXXXX; uid=dboXXXXXXXX; pwd=XXXXXXX")
oConn.Open()
oCom = New System.Data.SQLClient.SqlCommand()
oCom.Connection = oConn
oCom.CommandText = "SELECT * FROM tabla"
oDR = oCom.ExecuteReader()
While oDR.Read
Response.Write(oDR.Item("ID") & ", " & oDR.Item("NOMBRE"))
Response.Write("<BR>")
End While
catch
Response.Write("Error:" & err.Description)
Finally
oDR = Nothing
oCom = Nothing
oConn.Close()
oConn = Nothing
end try
End Sub
</script>
<html>
<title> Consultas a la bases de datos MS SQL con ASP.net</title>
<body bgcolor="FFFFFF">
<h2>consulta sobre la tabla <b>productos</b> con ASP.NET</h2>
<%Page_Data()%>
</body>
</html>



ejecuto estos codigos a traves de una ruta web, que me han proporcionado en el lugar de trabajo, no se donde seria el lugar optimo para ejecutarlo y que funcionase bien

un abrazo amigos...


empiezo a desesperar help me

Última edición por 60NZ4; 10/05/2012 a las 09:37