Hi this is my first post here, and this is my first time using XML, what got me to use XML was to refresh a portion of my webpage without refreshing the whole page. What I'm trying to do is for a user to Enter its FirstName and Lastname on a .html document and then I want to send this data to a .asp document which looks up the record in a database and then I want to display them on the .html document.
This is the code for the .htm document
This is the code for the .asp document
What am I doing wrong? this is my first venture in XML I read alot of articles about the XMLHTTP and XMLDOM, but couldn't quite figure it out, I would greatly appreciate all the help.
Thanx
Kinara
This is the code for the .htm document
Code:
<HTML>
<HEAD>
<META name=VI60_defaultClientScript content=VBScript>
<META NAME="GENERATOR" Content="Microsoft Visual Studio 6.0">
<TITLE></TITLE>
</HEAD>
<SCRIPT LANGUAGE = "VBSCRIPT">
Function fxsearch()
'msgbox("Hello" & " " & lname.value & ", " & fname.value)
' testing to see if the function is even being called on the click event
' it works until here
dim root
dim source
dim x
dim passpara
dim sT
passpara = "[URL unfurl="true"]http://192.168.1.151/getdata.asp?fname="[/URL] & _
fname.value & "&lname=" & lname.value
source = CreateObject("Microsoft.XMLDOM")
source.async = false
source.load(passpara)
root = source.documentElement
' for each x in source.documentElement.childNodes
' document.write("<b>" & x.nodename & "</b>")
' document.write(": ")
' document.write(x.text)
' document.write("<br>")
' next
Response.write sT
End Function
</script>
<BODY>
<P>First Name : <INPUT id=fname name=""><BR>Last
Name : <INPUT id=lname name=""></P>
<P><INPUT id=button1 style="LEFT: 9px; TOP: 82px" type=button value="Look Up!" onclick="fxsearch()" name=button1></P>
</BODY>
</HTML>
This is the code for the .asp document
Code:
<%@ Language=VBScript %>
<%
dim conn
dim rs
dim strsql1
dim fname
dim lname
fname = Request("fname")
lname = Request("lname")
set conn = server.CreateObject("ADODB.Connection")
conn.Provider = "Microsoft.Jet.OLEDB.4.0"
conn.Open = "C:\Inetpub\[URL unfurl="true"]wwwroot\test.mdb"[/URL]
strsql = "Select * from name where firstname ='" & fname & _
"' and lastname = '" & lname & "'"
set rs = server.CreateObject("ADODB.Recordset")
rs.Open(strsql,conn)
sT = sT & "<tableofnames>" & vbcrlf
do while not rs.EOF
sT = sT & "<name>" & vbcrlf
sT = sT & "<fname>" & rs("firstname") & "</fname>"
sT = sT & "<lname>" & rs("lastname") & "</lname>"
sT = sT & "</name>"
rs.MoveNext
loop
sT = sT & "</tableofnames>"
Response.Write sT
rs.Close
set rs = nothing
conn.Close
set conn = nothing
%>
What am I doing wrong? this is my first venture in XML I read alot of articles about the XMLHTTP and XMLDOM, but couldn't quite figure it out, I would greatly appreciate all the help.
Thanx
Kinara