|
Hi Fred,
Here is the code which we have used to set “mktdatapath”
mktdatapath=Request.Form("selmktdata")
For your Ref. I have also pasted the part of the code from the begining of this page below
------------------------------------------------------------------------------
<%@ Language=VBScript %>
<HTML>
<HEAD>
<META NAME="GENERATOR" Content="Microsoft Visual Studio 6.0">
<STYLE>
a{text-decoration:none;}
</STYLE>
</head>
<BODY TOPMARGIN=10 LEFTMARGIN=10 MARGINHEIGHT="10" MARGINWIDTH="10" BGCOLOR="#ffffff" TEXT="#000000" LINK="#003399" VLINK="#003399" ALINK="#003399">
<OBJECT RUNAT="server" PROGID="ADODB.Connection" id="ObjCon" name="ObjCon"> </OBJECT>
<OBJECT RUNAT="server" PROGID="ADODB.Recordset" id="Objrsrate" name="objrsrate"> </OBJECT>
<br>
<table width=750 border=0 cellpadding=0 cellspacing=0>
<tr>
<td align=center>
<!-- Start main content here -->
<table align="center">
<tr>
<td><form action="holdingsMD.asp" method="post" id=form1 name=form1>
<font size="2" face=verdana color="darkBlue"><b>Select Month and Year</b></font>:
</td>
<td> </td>
</tr>
<tr>
<td>
<%
dim mktdatapath,holdingspath,ask
ObjCon.Open "Provider=MSDAORA.1;Password=*****;User ID=******;Persist Security Info=True"
ask=Request.QueryString("ask")
'Response.write("current month" & month(date()))
thmonth=month(date())+1
thyear=year(date())
thday=day(date())
%>
<Select NAME="fdobm" id="fdobm" tabindex=1>
<OPTION value="01" <%if thmonth=1 then Response.Write "selected"%>>Jan</OPTION>
<OPTION value="02" <%if thmonth=2 then Response.Write "selected"%>>Feb</OPTION>
<OPTION value="03" <%if thmonth=3 then Response.Write "selected"%>>Mar</OPTION>
<OPTION value="04" <%if thmonth=4 then Response.Write "selected"%>>Apr</OPTION>
<OPTION value="05" <%if thmonth=5 then Response.Write "selected"%>>May</OPTION>
<OPTION value="06" <%if thmonth=6 then Response.Write "selected"%>>Jun</OPTION>
<OPTION value="07" <%if thmonth=7 then Response.Write "selected"%>>Jul</OPTION>
<OPTION value="08" <%if thmonth=8 then Response.Write "selected"%>>Aug</OPTION>
<OPTION value="09" <%if thmonth=9 then Response.Write "selected"%>>Sep</OPTION>
<OPTION value="10" <%if thmonth=10 then Response.Write "selected"%>>Oct</OPTION>
<OPTION value="11" <%if thmonth=11 then Response.Write "selected"%>>Nov</OPTION>
<OPTION value="12" <%if thmonth=12 then Response.Write "selected"%>>Dec</OPTION>
</SELECT>
<Select NAME="fdoby" id="fdoby" tabindex=3>
<OPTION VALUE="2010" <%if thyear=2010 then Response.write "selected"%>>2010</OPTION>
<OPTION VALUE="2009" <%if thyear=2009 then Response.write "selected"%>>2009</OPTION>
<OPTION VALUE="2008" <%if thyear=2008 then Response.write "selected"%>>2008</OPTION>
<OPTION VALUE="2007" <%if thyear=2007 then Response.write "selected"%>>2007</OPTION>
<OPTION VALUE="2006" <%if thyear=2006 then Response.write "selected"%>>2006</OPTION>
<OPTION VALUE="2005" <%if thyear=2005 then Response.write "selected"%>>2005</OPTION>
<OPTION VALUE="2004" <%if thyear=2004 then Response.write "selected"%>>2004</OPTION>
<OPTION VALUE="2003" <%if thyear=2003 then Response.write "selected"%>>2003</OPTION>
<OPTION VALUE="2002" <%if thyear=2002 then Response.write "selected"%>>2002</OPTION>
<OPTION VALUE="2001" <%if thyear=2001 then Response.write "selected"%>>2001</OPTION>
<OPTION VALUE="2000" <%if thyear=2000 then Response.write "selected"%>>2000</OPTION>
</SELECT>
</td>
</tr>
<tr>
<td><font size="2" face=verdana color="darkBlue"><b>Select Market Data File </b></font>:</td>
<td> </td>
</tr>
<tr>
<td><INPUT type="file" id="selmktdata" name="selmktdata"></td>
</tr>
<tr>
<td><font size="2" face=verdana color="darkBlue"><b>Select Client Holdings File </b></font>:</td>
<td> </td>
</tr>
<tr>
<td><INPUT type="file" id="selholdings" name="selholdings"></td>
</tr>
<tr>
<td> </td>
</tr>
<tr>
<td align="center"><input type="submit" name="submit" value="Click here To Submit file"></td>
<td height=70></form></td>
<tr>
</table>
<!-- End main content here -->
</td>
</tr>
<!-- This Row is used to display the insert details of holdings file and market data file -->
<tr>
<td align="center">
<%
if Request.Form("submit")<>"" then
dim myfile,genfile,filename,strlen,Item,filepath,holdingpath
holdingspath=Request.Form("selholdings")
mktdatapath=Request.Form("selmktdata")
monthdate=Request.Form("fdobm")&"/01/"&Request.Form("fdoby")
monthdate= cdate(monthdate)
monthdate=dateadd("m",1,monthdate)
monthdate=dateadd("d",-1,monthdate)
'************ Check if Holdings are already uploaded into portfolio_details for report month ********
qry ="select count(*) from portfolio_details where to_char(pf_date,'mm/dd/yyyy') = '"&monthdate&"'"
Objrsrate.open qry,objcon
if cint(Objrsrate(0)) > 0 then
Response.Write("Holdings already uploaded for the Report month<br>")
Response.End()
else
Objrsrate.close
end if
'********************************************** End of Checking ************************************
set myfile=Server.CreateObject("scripting.filesystemobject")
Response.Write holdingspath &" "&mktdatapath& "transaction updated <br>"
'*********************************** Inserting Market data into tbl_mktdata **************************
if mktdatapath <> "null" then
'mktdatapath="f:\monthly reports\holdings\01062006.MD" 'Server.MapPath()
set genfile = myfile.OpenTextFile(mktdatapath,1)
ObjCon.Execute "delete from tbl_mktdata" 'delete previous contents from tbl_mktdata
response.Write("Clear previous market data in tbl_mktdata <br>")
while not genfile.AtEndofStream
filecontent = genfile.readline
filearray= split(filecontent,",")
'Response.Write filearray(1) & " "&filearray(7) & "<br>"
'insert data into tbl_mktdata file
ObjCon.Execute "insert into tbl_mktdata values ('"&trim(filearray(1))&"',"&cdbl(filearray(7))&")"
wend
response.Write("end of market data<br>")
'' end of market data
else
Response.Write "<table align=center><tr><td height=250><font face=verdana size=2 color=red><b>No Market data File input</b></font></td></tr></table>"
Response.End
end if
'*********************************** End of Inserting Market data ************************************
.
.
.
.
.
.
.
</BODY>
</HTML>
------------------------------------------------------------------------------
As the code worked well before in previous machine I think it error is because of settings in IIS. But I’m not sure of it.
~Jagadeesh
hi all please clarify my doubt
-- modified at 6:05 Saturday 12th May, 2007
|
|
|
|
|
a) you might want to modify your posting to hide your password in your connectionstring..
b) Just setting
mktdatapath=Request.Form("selmktdata")
won't do what you want; you haven't actually uploaded the file - you need to do some research into uploading files to a sever in ASP...
Fred
|
|
|
|
|
mktdatapath=Request.Form("selmktdata")
Using that code my objective is to read the file path from where it is being upoaded.
I am using the following code to read the file.
set genfile = myfile.OpenTextFile(mktdatapath,1)
while not genfile.AtEndofStream
filecontent = genfile.readline
filearray= split(filecontent,",")
'insert data into tbl_mktdata file
ObjCon.Execute "insert into tbl_mktdata values ('"&trim(filearray(1))&"',"&cdbl(filearray(7))&")"
wend
-----------------------------------------
~JJ
hi all please clarify my doubts
|
|
|
|
|
It doesn't work like that. Request.Form("selmktdata") may tell you the path to the selected file on the local machine, but you haven't actually uploaded it to the server, and when you do the path there will be different.
You need to learn how to upload files, and save them to the server, then use that path in your OpentextFile method.
http://www.google.co.uk/search?hl=en&q=asp+upload&meta=[^]
Fred
|
|
|
|
|
Hi Fred,
Thanks for your patience;
I want to be clearer about the application.
1. It is not a web-based application. (It runs on our local machine) and we work directly on the machine where the application is configured.
2. We use this application to open the file read it and insert it into our DB (Every thing is done on a stand alone machine.)
3. This application is running smoothly for the past 3-4 years with out any issues.
4. Issue has arrised because the application has been moved to a different machine.
Your feedback is very valuable.
~Jagadeesh
hi all please clarify my doubts
|
|
|
|
|
Well I don't know then, I'm afraid... if the files are on the same machine too (if you're trying to read them across your network then it is, effectively, a web-based application) then I suspect it is, as said at the start, a permissions problem. Check your IIS settings and your windows users settings.
Fred
|
|
|
|
|
Yes, the files r on the same machine. What u suspected at the beginning is correct. It’s a permission problem. All IIS settings seem to be OK. I searched for these settings in net and the solutions did not work in my case. Running the application in windows admin mode also didn’t work in this case.
I'm seeking help in this regard. --> IIS settings and windows users settings, for trouble shooting this error.
Thank you Fred,
~Jagadeesh
hi all please clarify my doubts
|
|
|
|
|
GOT the Solution . The code is working fine now. The issue has arised here
set genfile=myfile.OpenTextFile(holdingspath,1)
because of permissions on the folders from where i am reading the files and the permissions on the (application)code folders.
Give full permissions to both folders. It works.
This link is helpful in this kind of situations.
http://www.aspemporium.com/tutorials.aspx?tid=9
Fred, Thank you very much for support.
~Jagadeesh
|
|
|
|
|
tell me the process to create a subdomain in my application
hi,
this is prasadchowdary
|
|
|
|
|
i want to create subdoamin in asp.net using C# how can i do that
hi,
this is prasadchowdary
|
|
|
|
|
I have a web form where i am created a pdf document through code. To do this, i am using a third party tool viz. ActivePDF. It takes about 5 to 10 minutes to create the document. Upon creation of the document, I am displaying the document in another page. Sometimes, what happens is i am getting the error 'page cannot be displayed' when i tried to display the document. Immediately everybody may feel that document is not available but actually the pdf document is generated. I am checking this thru code and if the file is available, then only i am displaying the pdf. the pdf size is hardly 1MB. the code is as follows
PDFCreationProcess()
if fileexists(pdf)
{
Response.write("window.open('" + pdfname + "'")");
}
pls help me urgently..
|
|
|
|
|
I feel your script might be timing out. Try increasing Server script timeout time.
Server.ScriptTimeout = 800000
Mubashir
Software Architect
Storan Technologies Inc, USA
Every job is a self portrait of the person who did it.
|
|
|
|
|
The .NET 2.0 Framework have a component for receive e-mails?
|
|
|
|
|
|
hi,
i have saved a video in my mysql database, and i want to dispaly it on my asp.net page.
th evideo is saved as BLOB type in the mysql.
can anybody help me?how can i retrive it?
thanks in advanced
|
|
|
|
|
hi.
I'm making a contact us form with asp.net 1.1 & C# .
the form has textbox which people can type their name,email and message ...
then they click the "send" button.
I want to recieve their message and name and email in my inbox not in my database!
because I have written the code which can save the message in the database.but it doesnt the thing that I want.!
I want to recieve their message and name and email in my inbox( I mean my email address inbox ).
So,please tell me how to do it ?
thank alot
|
|
|
|
|
You can do it by SMTP.
Regards,
Satips.
|
|
|
|
|
hi there:
try with System.Web.Mail Namespace
<< >>
|
|
|
|
|
|
|
Hi All,
http://www.tourneylogic.com/Products/BracketControl/Demos/V2/PopularTourneys/NCAA.aspx[^]
Can some one tell me how he has draw lines here.. is it a trick done using DIV/ CSS or using the graphic lib..
I also have asked to develop some thing similar.. I have some idea about how to go about here.. but performance wise and also cross browser compliancy wise I have some concerns.. can some one shoot couple of hints for me to correctly position myself..
High level tips should do well..
Thanks
L.W.C. Nirosh.
Colombo,
Sri Lanka.
|
|
|
|
|
I just found that it is a CSS solution as I off CSS of the browser..
Can some one give me a hint or two to do this little better than this..
L.W.C. Nirosh.
Colombo,
Sri Lanka.
|
|
|
|
|
Hi,
I need to create a login page in asp.net with password encryption, in order to login into an extranet application which has its own login page that should be hidden from the user. Make the user believe that they are loging into the application through the asp.net login page. Here the extranet application is built using java and is on sharepoint server.
Please provide info, suggestions and examples if possible for the above login page creation.
|
|
|
|
|
Hi everybody...
I`m having some problems with a web farm cenario.
The issue is: the ASP.NET create a couple of js files in one server, but when a requisition goes to another server in the web farm the file with the js function doesn`t exist.
To be more especific, I have a LinkButton on my page, and when this link is clicked it fires the 'WebForm_PostBackOptions' (which is 'undefined'sometimes).
Any hints about this problem? A web.config element configuration?
Thans you buddies
|
|
|
|
|
One thing you can do is put a value in each web.config for each server like a machine key or some other unique key then set a cookie with this key information to tie each user to that server.
At the very least this will keep the user locked to one server for that visit.
This will largely depend on how your server(s) are configured though.
|
|
|
|