Jump to content

theodore

Members
  • Content Count

    21
  • Joined

  • Last visited

Everything posted by theodore

  1. :)Sorry, I've missed something.. That's the name 'toolbar' of the frame is a reserved word..You should change it. For example, 'tool_bar'.And please remember that if you execute the script 'doSomething2()', the page may be redirected to another page. So the browser is unable to execute the script again.So I think it is better to create a <span> and use 'innerHTML' to change to text.For example, use the following code for the 'button.htm': <html><head><script>function doSomething2(){document.all.maintext.innerHTML="this is my document";}</script></head><body><span id="maintext"></span></body></html> And, you know, when the button2.htm is executed, the function 'doSomething2' will also be executed at once. So I think you should add a button to the page 'button.html':<input type="button" value="Click me!" onclick="java script:functionname()">create a JavaScript function:function functionname(){try{parent.tool_bar.doSomething2()}catch(e){alert(e);}} or directly link to the button.htm like this:<input type="button" value="Click me!" onclick="java script:parent.tool_bar.doSomething2()">Also, I think it is better to use:<script language="JavaScript">instead of<script>I hope it is work for your web page and my code is useful to you! (Am I talking too much?)
  2. It should be "<script>try{top.toolbar.doSomething2()}catch(e){alert(e);}</script>"Try
  3. From the code: Server.MapPath("/USERNAME/db/yourdatabase.mdb")--------------------------------------^The path of the database means SystemDrive/USERNAME/db/yourdatabase.mdbI think the website would not create a user folder under its drive root directory.Instead, you can use relative path, like Server.MapPath("yourdatabase.mdb") and upload the database to the folder with the asp pages. if you upload the databsee to a sub-folder, then Server.MapPath("[subfolder's name]/yourdatabase.mdb")do not put a "/"---^
  4. Thank you!Is there any other methods (JavaScript) which can read files from local drives, with running a online webpage?
  5. I am doing a coursework, and I have chosen HTML with JavaScript to do it.I have to read a text file and I have chosen AJAX to do it: function start(DocFile){ DocFile="file://"+DocFile; DocObject = getXmlHttpObject(getFileContent); DocObject.open("GET", DocFile , true); DocObject.send(null); }function getFileContent(){ if (DocObject.readyState==4 || DocObject.readyState=="complete"){ cDoc=DocObject.responseText; ....{main function} }} Originally, everything was alright. However, I have found that there is a big problem!!1. When I open the main webpage stored in a network drive, the webpage can only read text files from the drive but cannot read local drives files....2. When I upload the web page in a web hosting site, I cannot read any local files!!!Is this problem related to permission issue????I feel very sad about this problem. Please help me!!Do I have any other alternatives to read file???? (I don't want to include JAVA or swf or Applet)Thank you very very much!!!
  6. Are you sure that your ASP codes are correctly written? If no, you can add "on error resume next" after the first "<%" sentence. Try it!
  7. I think it's quite difficult to generate an Excel File. But it's easy to generate a CSV File>For example,Cell A1, A2, A3 are "A1", "A2", "A3" respectively.Cell B1, B2, B3 are "B1", "B2", "B3" respectively.then the contents of the csv files are:A1,B1A2,B2A3,B3I hope my suggestion could help.
  8. (I could not fully understand your problem. Sorry!)Hi, I hope my suggestion could help.I want to ask how you transfer the text from the form>1. <form method="get">2. <form method="post">if you're using "get" method,Request.QueryString("...")should be used.if you're using "post" method,Request.Form("...")should be used.
  9. Hi, I think the "MM_MoveFirst" is a link, right?So, I think the whole script should be <table border="0" width="15%" align="center"> <tr> <td width="25%" align="center"> <% If MM_offset <> 0 Then %> <input name="First" type="button" onClick="java script:window.location.href='<%=MM_MoveFirst%>'" value="First" /> <% End If ' end MM_offset <> 0 %> </td> <td width="25%" align="center"> <% If MM_offset <> 0 Then %> <input name="Previous" type="button" onClick="java script:window.location.href='<%=MM_MovePrevious%>'" value="Previous" /> <% End If ' end MM_offset <> 0 %> </td> <td width="25%" align="center"> <% If Not MM_atTotal Then %> <input name="Next" type="button" onClick="java script:window.location.href='<%=MM_MoveNext%>'" value="Next" /> <% End If ' end Not MM_atTotal %> </td> <td width="25%" align="center"> <% If Not MM_atTotal Then %> <input name="Last" type="button" onClick="java script:window.location.href='<%=MM_MoveLast%>'" value="Last" /> <% End If ' end Not MM_atTotal %> </td> </tr></table> The "javascript"s above is only one word.**I hope my suggestion could help you. :)Theodore
  10. Thank you for all of your help! I will try it later. :)
  11. Thank you for your help! However, I don't know how to use...
  12. How can I use JavaScript to read a text file? (I do not want to use ASP or PHP...)Thank you for your attention.!
  13. I think the code should be.... Code 1:Record 1<br>Title <input type="text" name="title"><br>Name <input type="text" name="name"><br>Address <input type="text" name="address"><br><br><br>Record 2<br>Title <input type="text" name="title"><br>Name <input type="text" name="name"><br>Address <input type="text" name="address"><br><br><br>Record 3<br>Title <input type="text" name="title"><br>Name <input type="text" name="name"><br>Address <input type="text" name="address"><br>Code 2:<%Dim adoCon Dim rsAddInformation Dim strSQL Set adoCon = Server.CreateObject("ADODB.Connection")adoCon.Open "DRIVER={Microsoft Access Driver (*.mdb)}; DBQ=" & Server.MapPath("data.mdb")Set rsAddInformation = Server.CreateObject("ADODB.Recordset")strSQL = "SELECT * FROM mine;"rsAddInformation.CursorType = 2rsAddInformation.LockType = 3rsAddInformation.Open strSQL, adoConDim title(100)Dim name(100)Dim address(100)for i=1 to Request.Form("title").Count()this_field1(i)=Request.Form("title")(i)this_field2(i)=Request.Form("name")(i)this_field3(i)=Request.Form("address")(i)rsAddInformation.AddNewrsAddInformation.Fields("title") = title(i)rsAddInformation.Fields("name") = name(i)rsAddInformation.Fields("address") = address(i)rsAddInformation.UpdatenextrsAddInformation.CloseadoCon.Close%> If you are inserting only three records, then you can chnage them into:Dim title(3)Dim name(3)Dim address(3)that means there are three arrays.Last, beware of the typing mistakes (including my typing mistakes, I haven't try the code) and if you have any problems, sign a message. Thanks.
  14. This is my problem-solving method.(It has been tested.)Code for inputing infomation:Information 1<br>Enter This <input type="text" name="this_field1"><br>Enter This <input type="text" name="this_field2"><br>Enter This <input type="text" name="this_field3"><br><br><br>Information 2<br>Enter This <input type="text" name="this_field1"><br>Enter This <input type="text" name="this_field2"><br>Enter This <input type="text" name="this_field3"><br><br><br>Information 3<br>Enter This <input type="text" name="this_field1"><br>Enter This <input type="text" name="this_field2"><br>Enter This <input type="text" name="this_field3"><br>Code for write the records to the MDB file:<%Dim adoCon Dim rsAddInformation Dim strSQL Set adoCon = Server.CreateObject("ADODB.Connection")adoCon.Open "DRIVER={Microsoft Access Driver (*.mdb)}; DBQ=" & Server.MapPath("my_database.mdb")Set rsAddInformation = Server.CreateObject("ADODB.Recordset")strSQL = "SELECT tblmine.this_field1, tblmine.this_field2, tblmine.this_field3 FROM tblmine;"rsAddInformation.CursorType = 2rsAddInformation.LockType = 3rsAddInformation.Open strSQL, adoConDim this_field1(100)Dim this_field2(100)Dim this_field3(100)for i=1 to Request.Form("this_field1").Count()this_field1(i)=Request.Form("this_field1")(i)this_field2(i)=Request.Form("this_field2")(i)this_field3(i)=Request.Form("this_field3")(i)rsAddInformation.AddNewrsAddInformation.Fields("this_field1") = this_field1(i)rsAddInformation.Fields("this_field2") = this_field2(i)rsAddInformation.Fields("this_field3") = this_field3(i)rsAddInformation.UpdatenextrsAddInformation.CloseadoCon.Close%> If it does not work, please tell me. ->>Note:You can edit the "100" of the following if the number of data is very large, that "100" means there are 100 records.Dim this_field1(100)Dim this_field2(100)Dim this_field3(100)
  15. ...I think you can fix the width of the tables by adding "width=...". Also, I have a quite good method.Create a webpage.the webpage should be devided into 2 frames, the upper frame and the lower frame.(You can set the size of the upper frame is smaller, then the upper page will on show the column names)Each frame's content is that webpage containing the data.
  16. I don't know this can help you or not.http://en.wikipedia.org/wiki/Web_Services_Security
  17. I don't know whether my method can help you or not. You can devide the data into two parts, the column names and the data.(You better put the data and the column names into two tables.)Then you can use "<div>" to fix the position of the table that containing the column names.After that, when you scrollup or down, the position of the column names displaying on the screen will not be changed.
  18. theodore

    drop down list

    Hi, you can try the method below:original,rsSearch.Open "select title from News WHERE month ='a';", connif a is a number, replace it intorsSearch.Open "select title from News WHERE month ='" & selected & "';", connif a isn't a number, replace it intorsSearch.Open "select title from News WHERE month =" & selected & ";", connabout problem 2, I don't what's the link and the target.Maybe you can try:add the link into this sentence:Response.Write (rsSearch("title"))-->response.write "<a href='...(link target)?xxx=" & rsSearch("title") & "...'>" & rsSearch("title") & "</a>"
  19. Hi, I think you're quite careless. First, "Your Name" isn't a correct name for varibles.Therefore, <%Your Name = Request.Form("name")Your Email = Request.Form("email")Your Url = Request.Form("url")Your Comments = Request.Form("commnets")%>should change into<%Name = Request.Form("name")Email = Request.Form("email")Url = Request.Form("url")Comments = Request.Form("commnets")%>Secondly, as you're using the function of "Request.Form", the method of the form to be sent should be "post", not "get". On the other hand, if you use "get" method, the Request.Form function should change into "Request.QueryString".Lastly, you spelt the word "comments" three times, but they are not respective."commnet", "commnets" and "comments".The whole script should be:<body><%Name = Request.Form("name")Email = Request.Form("email")Url = Request.Form("url")Comments = Request.Form("comments")%>Your Name : <%=name%><br />Your Email : <%=email%><br />Your Url : <%=url%><br />Your Comments : <%=comments%><br /><form action="#" method="post"> <p><input type="text" name="name" value="" size="30" tabindex="1" /><label for="author">Name (required)</label></p><p><input type="text" name="email" value="" size="30" tabindex="2" /><label for="email">E-mail (required, never displayed)</label></p><p><input type="text" name="url" value="" size="30" tabindex="3" /><label for="url"><abbr title="Uniform Resource Identifier">URL</abbr></label></p><p><textarea name="comments" cols="30" rows="10" tabindex="4"></textarea><label for="url"><abbr title="Uniform Resource Identifier">Comments</abbr></label></p><p><input name="submit" type="submit" tabindex="5" value="Submit Comment" /></p></form> </body>I hope this can solve your problem.Ps: My English is very poor, I hope you can understand what I say.
  20. Thank you very much!!!Your methods can solve my problem! Thanks.
  21. I have done a guestbook.There is a 'textarea' box in the sign page, and the contents of the textarea will be sent to a ASP page.Then the ASP file will insert the contents of the textarea into a MDB file.However, if I input:line1line2line3..in the textarea, and these three lines are saved in the MDB file.When I use a asp file to read the MDB file, the result is:line1 line2 line3How can I insert a serval of lines into a MDB file without changing into one line?Thank you very much.
×
×
  • Create New...