|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
doubts in asp
dear guys,
i have an asp coding which is intended to make a search in the server and list me all the documents that matches the search string i provide in a html page. asp page Code:
<html>
<body>
<%
dim Rs , Conn
Set Conn = CreateObject("ADODB.Connection")
Set cmd = CreateObject("ADODB.Command")
Set Rs = CreateObject("ADODB.RecordSet")
Conn.ConnectionString = "provider=msdaipp.dso"
Conn.CommandTimeout = 0
Conn.Open "http://kneserver4.wipro.com/kmtest/documents/Traniee"
If Response.IsServerConnected=true then
response.write("u r connected")
else
response.write("u r not connected")
end if
%>
</body>
</html>
html page Code:
<html> <head> <title> hgsAC </title> </head> <form id=my form action action="search.asp" method="post"> <input type="text" name=searchstring > <input type="submit" value="submit"> </form> iam not getting the results pls help me venki |
|
#2
|
|||
|
|||
|
with no information about the error provided, i can only say first try the url you are trying to open in a browser and check if it is right.
|
|
#3
|
|||
|
|||
|
iam sorry i have pasted the wrong asp coding here is the right one
Code:
<html>
<head>
<title>
hgsAC
</title>
</head>
<form action="search.asp" method="get">
<input type="text" name="searchstring" value="">
<input type="submit" value="click">
</form>
</html>
<html>
<body>
<%response.contenttype = "text/html" %>
<%request.querystring ('searchstring') %>
<%
Dim sResult
Sub Label1_Click()
'Execute Query
Set conn = CreateObject("ADODB.Connection")
OnErrorExit "Error creating object: ADODB.Connection"
Set cmd = CreateObject("ADODB.Command")
OnErrorExit "Error creating object: ADODB.Command"
Set rs = CreateObject("ADODB.RecordSet")
OnErrorExit "Error creating object: ADODB.Recordset"
conn.ConnectionString = "provider=msdaipp.dso"
conn.CommandTimeout = 0
conn.Open "http://kneserver4.wipro.com/kmtest/documents/Traniee", "tr7251","venkisgeethu"
OnErrorExit "Error opening connection"
Set cmd.ActiveConnection = conn
cmd.CommandText = "select ""DAV:displayname"" from scope('deep traversal of ""/kmtest/documents/Traniee""') where free text ("searchstring")"
OnErrorExit "Error setting command properties"
rs.Open cmd
OnErrorExit "Error executing query"
dumprowset rs
End Sub
Sub dumprowset(rs)
Label1.Visible = False
Dim i, j
Dim s
While Not rs.EOF
' sResult(i) = ""
'sHead = i & ") "
For j = rs.Fields.Count - 2 To rs.Fields.Count - 1
sResult = rs(j).Value & vbclrf
List1.AddItem sResult
Next
rs.MoveNext
Wend
'MsgBox i & " Results."
End Sub
%>
<% dim array(),i
strHTML = strHTML & "<SELECT>"
for i=1 to aray.length
strHTML = strHTML & "<OPTION value=""" & array(i) & """>""" & array(i) & """</OPTION>"
next i
strHTML = strHTML & "</SELECT>"
response.write strHTML
%>
</body>
</html>
i have done that but iam not getting connected and error page is comming venki Last edited by venki : September 5th, 2003 at 12:42 AM. |
|
#4
|
|||
|
|||
|
I assume you accidentally didn't past the closing quotation on CommandText assignment line?
|
|
#5
|
|||
|
|||
|
ok done
venki |
|
#6
|
|||
|
|||
|
post the solution as well. It might help others also.
|
![]() |
| Viewing: Dev Shed Forums > Programming Languages - More > ASP Programming > doubts in asp |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|
|