|
Well you may be trying to change the mode while the connection is open. You have to be sure to close the connection before changing the mode. Either that or make another connection that is read/write.
"Half this game is ninety percent mental."
- Yogi Berra
|
|
|
|
|
how Create a Rich Text File RTF in a ASP Page with header & footer
in this header how to include an image
N.Rajakumar B.E.,
Application Developer,
|
|
|
|
|
depending on which value is selected in a dropdown list for suppose a campus central,i have t run a query against database and should get those values into a text box.flow is like this.
sub showform
//java script funtion
function OOchange()
{
Campus=document.f1.Campus.options[document.f1.Campus.selectedIndex].value;
}
<% Do While NOT MyRS1.EOF %>
"><%= MyRs1("CampusName")%>
<% MyRS1.MoveNext
loop %>
//several fields like text boxes and all are present here....in of the textbox i shud display the recordset which we get bu querying database with that value in the Campus variable
<%
MYSQL2="Select distinct substring(collector_name,13,5) AS Code from svr_compare where substring(collector_name,1,4)= (select Collector_Code from CampCollCode where Division='?????????')"
Set MyRs2=MyConn.Execute(MySQL2)
Dim str
str=MyRS2("Code")
MyRS2.MoveNext
Do While NOT MyRS2.EOF
str=str & "," & MyRS2("Code")
MyRS2.MoveNext
loop
'end if
%>
<\form>
<\html>
}
end sub
the variable Campus which is the javascript function is a global asp variable.how to get that value to query it in the where condition of that sql query.I don't understand how to do that.Request.Form()to get the value selected in the drop down box.don't even know how to retreive the variable Campus which is in Java script function.plzzz help
Thanks in advance,
vani
|
|
|
|
|
bhavani_ge wrote: the variable Campus which is the javascript function is a global asp variable.
No, it's not. They are two completely separate variables. They don't exist in the same computer, and they don't exist at the same time.
To use the value in the asp code, you have to send the value from the page to the server, either as form data or in a querystring.
---
b { font-weight: normal; }
|
|
|
|
|
Thanks a lot for quick reply.Can you please give me the syntax of that.(form data or query string).I didn't understand how to use that.now i have that variable in javascript function how can i use that in the query which is the subroutine.
format is:
sub showform
java scriptfunction
{
Campus=some code;
<%
query-----where i want to use Campus
%>
here in this text box i shud get the result of that query
}
end sub
Thanks a lot in advance
|
|
|
|
|
Just put the value in the querystring when you reload the page:
window.location = 'ThePage.asp?campus=' + Campus;
Then you retrieve the value in the asp code:
strCampus = Request.QueryString("campus")
---
b { font-weight: normal; }
|
|
|
|
|
Thanks a Bunch!!! it worked....but.....after i select something in dropdownlist, the java script function is getting executed where i included
the following stattement........
if(document.f1.Campus.options[document.f1.Campus.selectedIndex].value)
{
Campus=document.f1.Campus.options[document.f1.Campus.selectedIndex].value;
alert(Campus);
window.location = 'svr_temp.asp?Campus=' + Campus;
//document.writeln('');
flag="true";
//alert(flag);
hidden_Team_Auto.style.display='block';
}Later on while running query i did this.........
<%
if request.querystring("Campus") <> "" then
MYSQL2="Select distinct substring(collector_name,13,5) AS Code from svr_compare where substring(collector_name,1,4)= (select Collector_Code from CampCollCode where Division='"& request.QueryString("Campus")& "')"
Set MyRs2=MyConn.Execute(MySQL2)
Dim str
str=MyRS2("Code")
MyRS2.MoveNext
Do While NOT MyRS2.EOF
str=str & "," & MyRS2("Code")
MyRS2.MoveNext
loop
end if
%>
As i kept alert statement in the javascript function once i click that alert box...data fields are getting displayed in the textbox.But immediately the page is refreshing and is giving error.if i remove that alert box...i am not getting data in the textbox...and again the web page is refreshing itself.....plzzz help me in this.
|
|
|
|
|
You have to display the field after the page reloads, not before.
What is the error you get?
---
b { font-weight: normal; }
|
|
|
|
|
Hi,
What actually is happening is when i select something in the dropdown list,it should catch that value and should run a query against the database and should fill those recrds in a textbox and then that textbox should become visible.
Now what's happening is as soon as i select something in the dropdown box there comes an alert box...when i click that alert box...only then the data is being populated in the textbox...then again the web page is getting refreshed because of which undesired outputs are coming.
I want data to be displayed in the textbox with out alert box....and also after displaying the data in the textbox i don't the web page to be refreshed automatically..............
here is the code for that..........Please help me in this
Thanks,
vani.
<%@ LANGUAGE="VBSCRIPT" %>
<%
If Request.Form("Submit") = "" Then
SetReportLog
ShowForm
Else
ShowCrystalReport
End IF
Dim Campus
Dim flag
flag = "false"
Sub ShowForm
%>
<%
'''MySQL = "select distinct convert(varchar(10),Course_Off_Start_Date,101) as StartDate from SVR where datename(dw, course_off_start_date) in ('Thursday','Tuesday') order by StartDate"
MySQL = "select distinct convert(varchar(10),Course_Off_Start_Date,101) as StartDate from SVR order by StartDate"
Set MyRs=MyConn.Execute(MySQL)
%>
<%
MySQL1 = "Select CampusName from onlinecampus order by CampusName"
Set MyRs1=MyConn.Execute(MySQL1)
%>
@import "../inc/uopstu.css";
<title>SVR StartDate Selection
Select a Campus Name
<% Do While NOT MyRS1.EOF %>
"><%= MyRs1("CampusName")%>
<% MyRS1.MoveNext
loop %>
<%
if request.querystring("Campus") <> "" then
'response.Write("hi")
'response.End
MYSQL2="Select distinct substring(collector_name,13,5) AS Code from svr_compare where substring(collector_name,1,4)= (select Collector_Code from CampCollCode where Division='"& request.QueryString("Campus")& "')"
Set MyRs2=MyConn.Execute(MySQL2)
Dim str
str=MyRS2("Code")
MyRS2.MoveNext
Do While NOT MyRS2.EOF
str=str & "," & MyRS2("Code")
MyRS2.MoveNext
loop
end if
%>
<%
End Sub
Sub ShowCrystalReport
some code..............
<% End Sub %>
|
|
|
|
|
If you don't want the alert box, then just remove the code that shows the alert box.
and also after displaying the data in the textbox i don't the web page to be refreshed automatically
Are you saying that the page is reloaded twice?
---
b { font-weight: normal; }
|
|
|
|
|
If i remove the alert box the data is not getting into the textbox.Only after i click the alert box the page is getting refreshed and data is getting into the textbox i guess.......if i remove that alert nothing is happening in the page....that is one issue.
Now when i click the alert box the records are getting into the textbox but immediately the page is getting refreshed or loaded again and all the data is disappearing.
What am i supposed to do in this.Please help me in this.
-- modified at 15:16 Tuesday 13th December, 2005
|
|
|
|
|
bhavani_ge wrote: If i remove the alert box the data is not getting into the textbox.
Yes, it is, but you don't show the textbox, so you don't see it.
bhavani_ge wrote: if i remove that alert nothing is happening in the page
Yes it is. The page is reloaded and the textbox is populated with the correct data.
bhavani_ge wrote: Now when i click the alert box the records are getting into the textbox
No, you show the textbox, but it doesn't contain the correct data. Only after the page has reloaded the textbox is populated with the correct data.
bhavani_ge wrote: the page is getting refreshed or loaded again and all the data is disappearing.
Yes, that is what I'm saying. You have to show the textbox after the page has reloaded, not before.
---
b { font-weight: normal; }
|
|
|
|
|
Thanks a lot.........
I tried to display the textbox after the page reloads...but i couldn't .It might be an easy thing to do...but i am new to asp and don't know how to do that.....can you please tell me how to do that
here is my present code.....
<%@ LANGUAGE="VBSCRIPT" %>
If Request.Form("Submit") = "" Then
SetReportLog
ShowForm
Else
ShowCrystalReport
End IF
Sub ShowForm
@import "../inc/uopstu.css";
<title>SVR StartDate Selection
Select a Campus Name
<% Do While NOT MyRS1.EOF %>
"><%= MyRs1("CampusName")%>
<% MyRS1.MoveNext
loop %>
<%
if request.querystring("Campus") <> "" then
'response.Write("hi")
'response.End
MYSQL2="Select distinct substring(collector_name,13,5) AS Code from svr_compare where substring(collector_name,1,4)= (select Collector_Code from CampCollCode where Division='"& request.QueryString("Campus")& "')"
Set MyRs2=MyConn.Execute(MySQL2)
Dim str
str=MyRS2("Code")
MyRS2.MoveNext
Do While NOT MyRS2.EOF
str=str & "," & MyRS2("Code")
MyRS2.MoveNext
loop
end if
%>
<%
'Close the connection
'MyRs.Close
'Set MyRs = Nothing
'Set MyConn = Nothing
End Sub
Sub ShowCrystalReport
End Sub
-- modified at 12:23 Wednesday 14th December, 2005eNext
Do While NOT MyRS2.EOF
str=str & "," & MyRS2("Code")
MyRS2.MoveNext
loop
end if
%>
<%
'Close the connection
'MyRs.Close
'Set MyRs = Nothing
'Set MyConn = Nothing
End Sub
Sub ShowCrystalReport
End Sub
|
|
|
|
|
.........
I tried to display the textbox after the page reloads...but i couldn't .It might be an easy thing to do...but i am new to asp and don't know how to do that.....can you please tell me how to do that
here is my present code.....
<%@ LANGUAGE="VBSCRIPT" %>
If Request.Form("Submit") = "" Then
SetReportLog
ShowForm
Else
ShowCrystalReport
End IF
Sub ShowForm
@import "../inc/uopstu.css";
<script language="JavaScript" type="text/javascript">
</script>
</head>
<body >
<form method=post name=f1 ID="Form1" action="svr_temp.asp">
<tr id="hidden_Division" style="display:none;"><td align=right width=50% height="22">Select a Campus Name</td><td align=left height="48"><select Name="Campus" Size="1" onChange="OOchange()" ID="Select2">
<% Do While NOT MyRS1.EOF %>
<option Value="<%= MyRS1("CampusName") %>"><%= MyRs1("CampusName")%></option>
<% MyRS1.MoveNext
loop %>
</select>
</td></tr><%
if request.querystring("Campus") <> "" then
'response.Write("hi")
'response.End
MYSQL2="Select distinct substring(collector_name,13,5) AS Code from svr_compare where substring(collector_name,1,4)= (select Collector_Code from CampCollCode where Division='"& request.QueryString("Campus")& "')"
Set MyRs2=MyConn.Execute(MySQL2)
Dim str
str=MyRS2("Code")
MyRS2.MoveNext
Do While NOT MyRS2.EOF
str=str & "," & MyRS2("Code")
MyRS2.MoveNext
loop
end if
%>
<tr id="hidden_Team_Auto" style="display:none;"><td align=left height="48"><input type=text name=TeamNumAuto maxlength=25 size=15 value= "<% =str %>" ID="Text1">
</td></tr></form>
</body>
<%
'Close the connection
'MyRs.Close
'Set MyRs = Nothing
'Set MyConn = Nothing
End Sub
Sub ShowCrystalReport
End Sub
-- modified at 12:23 Wednesday 14th December, 2005eNext
Do While NOT MyRS2.EOF
str=str & "," & MyRS2("Code")
MyRS2.MoveNext
loop
end if
%>
<tr id="hidden_Team_Auto" style="display:none;"><td align=left height="48"><input type=text name=TeamNumAuto maxlength=25 size=15 value= "<% =str %>" ID="Text1">
</td></tr></form>
</body>
<%
'Close the connection
'MyRs.Close
'Set MyRs = Nothing
'Set MyConn = Nothing
End Sub
Sub ShowCrystalReport
End Sub
|
|
|
|
|
bhavani_ge wrote: I tried to display the textbox after the page reloads
I don't see anything in the code that suggests that you have tried that?
---
b { font-weight: normal; }
|
|
|
|
|
i didn't paste as something which i tried didn't work at all....and i am like didn't know how to go about it.....can you please tell me what i am supposed to do to display the textbox after the page loads.....
Thanks a lot,
Vani.
-- modified at 13:49 Monday 19th December, 2005
|
|
|
|
|
Just don't hide it.
---
b { font-weight: normal; }
|
|
|
|
|
But, i have to hide that textbox initially.when i select an item in the dropdown box a textbox will become visible and will be filled with data from the database depending on the item selected in the dropdown box.to retain a java variable value to be used in the query which is in vbscrip i used request.form() and posted the asp page back to the same page.Every thing is fine but, once the data is populated in the textbox immediately the page is posting back and all of them...textbox and dropdown box are all again disappeared after the page is loaded.....please tell me how to retain them even after the page is loaded......
|
|
|
|
|
You still obviusly don't know what happens when the page is reloaded.
The page is not posting back after the textbox is populated, but before.
---
b { font-weight: normal; }
|
|
|
|
|
ok...but before the textbox is populated i didn't c any loading of th page...but as soon as the textbox is populated....the page is automatically refreshed and all those controls on the page which i made visble depending on the items selected in the text box were all disappeared and the initial page is displayed.....i just want to have those controls on the page as they were even after the textbox is populated...please let me know what i am supposd t do for this.......
Thanks a lot for yuor help,
Bhavani.
|
|
|
|
|
No, the textbox is not populated when you think it is. It's just displayed with the previous value. Then the page reloads, and the textbox is populated, but as you hide the textbox, you won't see that.
What you need to do is:
:: Don't show the textbox before reloading the page. It's no use, as it doesn't contain the correct data.
:: When the textbox has been populated, make sure that it's not hidden when the page loads again. Just remove the property that hides it.
---
b { font-weight: normal; }
|
|
|
|
|
In a web page design ...
I am using iframes to show web pages from another website under Mozilla 1.6 webbrowser (Mozilla/5.0). But of three iframes, 1 is showing mostly question marks instead of the html content.
It doesn't matter if this main web page is stored in ascii or unicode. And the content loaded, via a script, into the iframes are in ascii (and delivered via the personal web server on win2000).
The problem kinda seems to be related to treating ascii as unicode, or vice versa.
Any ideas how to fix this problem? (note: no problem occurs on IE6 )
Thanks
|
|
|
|
|
Hi,
I need to implement some function like, when the database is updated through one page, the other page, which is listing all the records, should be refreshed automatically and display newly updated recordset.
I was thinking using trigger. But it seems that it only can update tables within the database itself.
How to trigger the browser to reload and keep the data on the page updated?
Can anyone give some ideas?
Thanks in advance!
|
|
|
|
|
Hi there,
For this, IMO, you might set the client browser will refresh itseft after an interval time , and also should have a look at AJAX technology about how to refresh a part of webpage to increase performance.
<< >>
|
|
|
|
|
Hi, Thank you for information. It definitely give me some clues. I will look into it...
|
|
|
|