View Single Post
  #1 (permalink)  
Old November 13th, 2004, 11:00 PM
menesesg menesesg is offline
Registered User
Join Date: Jun 2003
Location: Mexico city, D,F, Mexico.
Posts: 5
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to menesesg
Default A simple question about databases


I hope anybody can help me!!!

This is my first time in Databases, I am using a simple Access Database with the ODBC connection. All I am doing is to ask the user its number employee and then return the information according to its profile and allow the user to access into a certain URL, everything at this point works fine, my query is ok, and the data displays ok, but when the number employee is not in the database I want to send a message telling the user he is not subscribe, and here is my problem I don´t know how to get the method for returning the message, I mean which code I can use to do my condition if(x== "null") or something then Response.Write("Sorry, you are not subscribe"). I think this must be pretty natural but I can´t find the method to do it

Please Help me !! is all I need to finish my work.

Here is my code:

<title>Información general</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<style type="text/css">
.style2 {
    font-family: Arial, Helvetica, sans-serif;
    font-size: 14px;
    font-weight: bold;
    color: #CC0000;
.style5 {font-family: Arial, Helvetica, sans-serif; font-size: 12px; }
<script language="JavaScript" type="text/JavaScript">

function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
    <TD BGCOLOR="#000066"><B>RESULTADOS DE LA B&Uacute;SQUEDA</B></TD>

//se genera la conexión con la base de datos y se llena la lista con los resultados

    var expediente = Request.QueryString("exp1");
    var adoConnection = Server.CreateObject("ADODB.Connection");
    var adoRecordSet;
    var mySQL;
    var mySQL = "SELECT Usuarios.Expediente, Usuarios.Nombre, Perfiles.DescPerf, Curricula.URL" + " FROM (Curricula INNER JOIN (Usuarios INNER JOIN Inscritos ON Usuarios.Expediente = Inscritos.Expediente) ON Curricula.Clave = Inscritos.[Puesto inscrito]) INNER JOIN Perfiles ON Usuarios.Perfil = Perfiles.Clave_perf" + " WHERE (((Inscritos.Expediente))=" + expediente + ")";
    adoRecordSet = adoConnection.Execute(mySQL);

// hace loop en la base y al terminar, trae los datos a la página WEB

    while( adoRecordSet.Eof == false)
<P ALIGN="LEFT"><B>Nombre: <%=adoRecordSet("Nombre").Value%></B></P>
<P ALIGN="LEFT"><B>Número de expediente: <%=adoRecordSet("Expediente").Value%></B></P>
<P ALIGN="LEFT"><B><%=adoRecordSet("DescPerf").Value% ></B></P>
<img src="media/iniciar1.gif" width="82" height="36" onclick="window.location.replace('<%= adoRecordSet("URL").Value%>')">



// cierra el recordset y la conexión
// y libera la memoria utilizada por la rutina del Recordset y los objetos de Conexión

    adoRecordSet = null;
    adoConnection = null;

Thanks in advance.

Reply With Quote