Jump to content

denny911

Members
  • Posts

    88
  • Joined

  • Last visited

Everything posted by denny911

  1. I think it's possible your database itself doesn't give you permission to write.I suggest you do the following:1. right click on your database, select SECURITY and you should be seeing something like this INTERNET GUEST ACCOUNT (your-comp-name etc.)2. when you select it, check all the check boxes below in ALLOW column in order to gain those permissions..3. try to fill the form in again..NOTE: this is only one of the possible reasons..
  2. Ok, but how i display individual records? with my code i put this:<% Response.Write(p(0,0)) %> for the first record and the first field in the first record, and so on..what i put using your code in order to display records or fields where i want them to appear?
  3. I have this piece of code.<%Set conn = Server.CreateObject("ADODB.Connection")conn.Provider="Microsoft.Jet.OLEDB.4.0"conn.Open(Server.Mappath("mydb.mdb"))Set rs = Server.CreateObject("ADODB.recordset")dataSQL = " SELECT * FROM shouts ORDER BY time"rs.Open dataSQL, connp=rs.GetRows(10,0)%>In this code, I'm able to get 10 records (those that were added first), since their time is oldest.What I need is to get 10 last added records from the table "shouts", that is, records should be sorted from the newest time to the latest.What code should I use to accomplish that?Thanks!
  4. Jerome, you managed to help me 2 times so far. Please, try to help me again.My previous problem was how to display one particular article according to the ID contained in the link (news.asp ----> details.asp?ID=123)Now, with your help I am able to open an article on the details.asp page. But, beneath the article I would like to have a link named Comment. When a user clicks it, I want a window to pop-up and open a page, let's call it comment.asp.I've made that pop-up window, and also comment.asp page and even form and database for users' comments.I used this code:<%set conn=Server.CreateObject("ADODB.Connection")conn.Provider="Microsoft.Jet.OLEDB.4.0"conn.Open(Server.Mappath("testdb.mdb"))sql="INSERT INTO comments (nick, comment)"sql=sql & " VALUES "sql=sql & "('" & Request.Form("nick") & "',"sql=sql & "'" & Request.Form("comment") & "');"on error resume nextconn.Execute sql,recaffected%>so I'm able to insert a comment in the form placed on the page, and data is sent to the database.The code below lists selected fields from a table named "comments".<%set rs = Server.CreateObject("ADODB.recordset")dataSQL = "SELECT nick, comment, time FROM comments"rs.Open dataSQL, conndo until rs.EOF for each x in rs.Fields Response.Write(x.value & "<br/>") next Response.Write("</br>") rs.MoveNextloopconn.close%>So, when opened in pop-up window, comment.asp page basically looks like this:----------------------------------------------------------------------------------------------DONALD DUCKThis is the Donald's comment about some article.13.11.2005 18:28:14ROAD RUNNERThis is Road Runner's comment.10.11.2005 12:04:19Nick: |______________________________________________Comment: |__________________________________________SUBMIT RESET-----------------------------------------------------------------------------------------------But, this code lists all comments (that is, records) from the table. I would like to have one table that will contain comments for all articles on my site. So, similar to my previous problem, if a user gets to the article from news.asp by clicking link .../details.asp?ID=123, I want the link Comment to be ..comment.asp?ID=123 and, after clicking that link, a pop-up window would be displayed opening comment.asp page that would display comments about ONLY the article ID=123.Can you tell me how to organize my comments table (or maybe it's better to make a database for comments only?) and also write me down some code to use in my comment.asp page to have it display only comments I want it to display and NOT all the records contained in a table.Thank you!Denis K., Bosnia H.P.S. If you need more details about anything, feel free to ask.
  5. i just wanted to thank you for your help. this code has completely done what i wanted it to do.Thanks again, Jerome!
  6. I will have lots of links (in this form: http://www.mysite.info/news/details.asp?ID=xxx) on my site. When a user clicks such a link, the page details.asp loads and displays the detailed article for some news.For example:TITLE OF SOME NEWS ARTICLEThis is the content of the news article. It should be loaded from the database I created for news to be stored.Now, I have created a database called "news-database.mdb" which contains a table named "news_tbl". The table's fields are shown below:________________________________________________ID | news_title | news_content |------------------------------------------------------------------------------------101 | title 101 | content 101 |202 | title 202 | content 202 |303 | title 303 | content 303 |and so on... |------------------------------------------------------------------------------------I've tried putting this code in the "details.asp" page:<% dim ID ID = Request.QueryString ("ID") set conn = Server.CreateObject("ADODB.Connection")conn.Provider="Microsoft.Jet.OLEDB.4.0"conn.Open(Server.Mappath("news-database.mdb"))set rs = Server.CreateObject("ADODB.recordset")dataSQL = "SELECT * FROM news_tbl WHERE ID = " & ID & ""rs.Open dataSQL, conn%>And this code where I want my data to appear:<% Response.Write(dataSQL) %>This is supposed to close the connection:<%rs.closeset rs = nothingconn.closeset conn = Nothing%>The problem is: when I click the link, let's say http://www.mysite.info/news/details.asp?ID=202, instead of data from the database's table record with the ID=202, it is displayed: SELECT * FROM news_tbl WHERE ID = 202I tried to replace this piece of code: dataSQL = "SELECT * FROM news_tbl WHERE ID = " & ID & "" with this one: dataSQL = "SELECT news_content FROM news_tbl WHERE ID = " & ID & "" but it just doesn't seem to make any difference since the result is the same: SELECT news_content FROM news_tbl WHERE ID = 202 and NOT: content 202 (as it is in the database)Can anyone tell me what should I do in order to make this work, that is, when ID in link's querystring is 202, to have displayed record from my database..I will really appreciate if someone rewrites this code to make it work..Thanks!Denis K.
  7. Sorry, this is NOT working.. I've made a new post, so if you are interested, you can look what the problem is..
  8. thank you for your reply, i'll try to implement this right away.so if i do not come back, THANKS again !!denis, bosnia h.
  9. Helloi've made a simple MS access database to store the news articles for my future info portal.the database is named test.mdb . It contains a table named news_tblIt looks something like this:id | news_header | news_content-------------------------------------------------------------------------------------------123 SOME TITLE corresponding content456 OTHER TITLE other contentetc._____________________________________________________now, i have this ASP code:<%set conn=Server.CreateObject("ADODB.Connection")conn.Provider="Microsoft.Jet.OLEDB.4.0"conn.Open(Server.Mappath("test.mdb"))set rs = Server.CreateObject("ADODB.recordset")rs.Open "Select * from news_tbl", conn'The first number indicates how many records to copy'The second number indicates what recordnumber to start onp=rs.GetRows(2,0)%><% response.write(p(1,0))%><br> --------> i insert this code where i want my title to appear<%response.write(p(2,0))%> --------> i insert this where i want the content to appear<%rs.closeconn.close%>this code displays the value (content) of corresponding fields above (in this case, it will displaySOME TITLEcorresponding contentand that is only for the table row which id is 123.BUT.. i intend to have a lots of links which will be something like this: http://www.my-site.info/news/news-details.asp?id=xxx (xxx=any 3 numbers).. when a user clicks on such a link, i want the code to display the records from a row with the id=xxxwhat i have to do in order to have the page news-details.asp displaying records from only the table row with the id contained in the link?if anyone helps me in any way, i will be very grateful.
  10. denny911

    ASP help needed !

    hello!i need to place a simple poll on my website. can anyone describe the process in several simple steps? can i have a MS access database? how simple can it be (what should it contain in order to collect data from polls?)i have already made the skeleton of the poll in HTML (form with radio buttons).i'd also want the results of the poll to be displayed (on the same place where the poll is) in percents after the submit button is clicked.i hope i made my problem clear enough. if not, let me know..Thanksp.s. for those who really find it difficult to picture what i really want to do,visit http://w3schools.invisionzone.com/index.ph...pic=153&hl=polland you'll see the exact poll that i would like to have
  11. denny911

    ASP help needed !

    Hello.I know so little about ASP but I find it very useful and exciting. However, I started to learn it's basics just yesterday since I want to use it on my site.Now, I need your help. I want the text of my (css controlled) navigational links to be dynamically inserted by ASP, using <--#include file=" "--> piece of code. What I managed to do so far is to make individual .inc files for every button (text link) of my main navigation menu.But, I wonder if it's possible to have only one .inc file that would contain the text of the whole menu. For example, the file mainMenu.inc would then be included in appropriate places in page-menu's code, but only a part of the file would be displayed for each of the links.I've considered using the IF - THEN function but I don't know how to implement that (actually I don't even know if that is possible).I will appreciate any kind of help. Denis, Bosnia H.
×
×
  • Create New...