Hi, I have the below asp code. I know.... asp lol. But thats what I have to use. Ok here it is:
<%
Dim oRS, oConn
Set oConn = Server.CreateObject("ADODB.Connection")
oConn.ConnectionString = "Driver={Microsoft Access Driver (*.mdb)};" & _
"DBQ=" & Server.MapPath("dbb.mdb")
oConn.Open
Set oRS = Server.CreateObject("ADODB.Recordset")
oRS.Open "select * from tblTest", oConn, 2, 3
If oRS.EOF Then
Response.Write "none"
End If
If Not oRS.EOF Then
Response.Write oRS("Title")
End If
oRS.Close
Set oRS = Nothing
oConn.Close
Set oConn = Nothing
%>
When this script is called I expect it to send back the title value in oRS. The html page is:
<html>
<title>Hi</title>
<body bgcolor="#DDDDDD">
<SCRIPT TYPE="text/javascript" LANGUAGE="JavaScript">
function requestNames() {
document.body.style.cursor='wait';
var oXMLHTTP = new ActiveXObject("Microsoft.XMLHTTP");
var sURL = "full path removed.asp"
oXMLHTTP.open( "POST", sURL, false );
oXMLHTTP.send();
if (oXMLHTTP.responseText == "none")
alert("No Values");
if (oXMLHTTP.responseText != "none")
alert(oXMLHTTP.responseText);
document.body.style.cursor='auto';
}
</SCRIPT>
<input type="submit" value="Submit" onClick="requestNames()"/>
</body>
</html>
When I run this, if no results are found the alert No Values is shown, however, if records are found the title is not shown in the alert. SOme html is shown instead inside the alert. Ahy help would be much appriciated.
<%
Dim oRS, oConn
Set oConn = Server.CreateObject("ADODB.Connection")
oConn.ConnectionString = "Driver={Microsoft Access Driver (*.mdb)};" & _
"DBQ=" & Server.MapPath("dbb.mdb")
oConn.Open
Set oRS = Server.CreateObject("ADODB.Recordset")
oRS.Open "select * from tblTest", oConn, 2, 3
If oRS.EOF Then
Response.Write "none"
End If
If Not oRS.EOF Then
Response.Write oRS("Title")
End If
oRS.Close
Set oRS = Nothing
oConn.Close
Set oConn = Nothing
%>
When this script is called I expect it to send back the title value in oRS. The html page is:
<html>
<title>Hi</title>
<body bgcolor="#DDDDDD">
<SCRIPT TYPE="text/javascript" LANGUAGE="JavaScript">
function requestNames() {
document.body.style.cursor='wait';
var oXMLHTTP = new ActiveXObject("Microsoft.XMLHTTP");
var sURL = "full path removed.asp"
oXMLHTTP.open( "POST", sURL, false );
oXMLHTTP.send();
if (oXMLHTTP.responseText == "none")
alert("No Values");
if (oXMLHTTP.responseText != "none")
alert(oXMLHTTP.responseText);
document.body.style.cursor='auto';
}
</SCRIPT>
<input type="submit" value="Submit" onClick="requestNames()"/>
</body>
</html>
When I run this, if no results are found the alert No Values is shown, however, if records are found the title is not shown in the alert. SOme html is shown instead inside the alert. Ahy help would be much appriciated.