Jump to content

theodore

Members
  • Content Count

    21
  • Joined

  • Last visited

Community Reputation

0 Neutral

About theodore

  • Rank
    Newbie
  • Birthday 12/05/1990

Profile Information

  • Location
    KLN, Hong Kong
  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.
×
×
  • Create New...