Jump to content

theodore

Members
  • Posts

    21
  • Joined

  • Last visited

Everything posted by theodore

  1. 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.
  2. 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)
  3. ...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.
  4. I don't know this can help you or not.http://en.wikipedia.org/wiki/Web_Services_Security
  5. 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.
  6. 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>"
  7. 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.
  8. Thank you very much!!!Your methods can solve my problem! Thanks.
  9. 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...