Jump to content

choobakka

Members
  • Posts

    69
  • Joined

  • Last visited

Everything posted by choobakka

  1. PROBLEM SOLVED i did some research and found out that the word 'password' is a reserved word in ADO/OLEDB. chnaged the name in the database and in the sql statement and it worked a charm.thanks for all your help guys
  2. choobakka

    final hurdle

    i have been working through this tutorial which i have which shows you how to create a complete website/blog/forum using Dreamweaver and ASP. i have it working exactly as i want except for one thing:i have one page which pulls all of the data from an MS Access database table and presents it on the webpage. when i click on the ID number of each row, i am taken to another webpage where i am presented with the records related only to that ID. on this 2nd page i am able to edit the details and submit them back to the database.the third webpage i have is a login page which interacts with the database. however, this login feature will only take me to the first record in the table and allow me to edit it (page 2)what i would like to happen is to completely bypass the first page (with the complete table) and have the user login with their username and password and then they would be directly presented with their related data to edit and resubmit to the database.how can i do this?
  3. i have some static webpages which i have created. they contain pictures embedded within the webpage (ie they are not retrieved from a database).what i would like to do is have the user type in a username and password and then be presented with the webpage(s) whihc are relevant to that username/password. how would i go about this and how would i link the webpages to particular usernames?thanks in advance
  4. Siddhesh said on page 3: Copy this querry and run it from backend(i.e. Querry analyser etc)i dont know what that means!
  5. what do u mean Copy this querry and run it from backend(i.e. Querry analyser etc)
  6. what you see above is the FULL code for that ASP page. it is supposed to update data in my database when it is called from a button press on another ASP page!however, this does not happen, NOTHING HAPPENS!!!!
  7. still no change.since copying the code from the tutorials on this site, the code within the tutorials has changed.so i added the new code but now i dont get any messages about not being able to update/delete. i simply get a blank screen and there is no change in the database. the new code is as follows:<html><head><title>Submit DataBase</title></head><body><h2>Submit to Database</h2><%on error resume nextset conn=Server.CreateObject("ADODB.Connection") conn.provider="Microsoft.Jet.OLEDB.4.0"conn.open(server.mappath("Disso1.mdb"))if Request.form("action")="Save" then CustomerID=Request.Form("CustomerID")sql="UPDATE tblCustomer SET CustomerID="' & Request.Form("CustomerID") & '"," sql=sql & "Last_Name='" & Request.Form("Last_Name") & "'," sql=sql & "First_Name='" & Request.Form("First_Name") & "'," sql=sql & "Address1='" & Request.Form("Address1") & "'," sql=sql & "Address2='" & Request.Form("Address2") & "'," sql=sql & "Address3='" & Request.Form("Address3") & "'," sql=sql & "Post_Code='" & Request.Form("Post_Code") & "'," sql=sql & "Telephone1='" & Request.Form("Telephone1") & "'," sql=sql & "Telephone2='" & Request.Form("Telephone2") & "' ," sql=sql & "Username='" & Request.Form("Username") & "' , " sql=sql & "Password='" & Request.Form("Password") & "' , "sql=sql & " WHERE tblCustomer.[CustomerID]=" & CustomerID' conn.Execute sql, Recordsaffected'if err <> 0 then' Response.Write("hello.")else' Response.Write("Record number " & CustomerID & " was updated.")' end if Response.Write("Submitting records not possible")end ifif Request.Form("action")="Delete" then CustomerID=Request.Form("CustomerID")' conn.Execute "DELETE FROM tblCustomer WHERE tblCustomer.[CustomerID]=" & CustomerID, Recordsaffected' if err <> 0 then' Response.Write("You do not have permission to delete a record from this database!")' else ' Response.Write("Record number " & no & " was deleted.")' end if Response.Write("Deleting records not possible")end ifconn.close%></body></html>from what i can see, the code in red has been added in the tutorials but i still get the same result. all i want to be able to do is update the records in the database. any other ideas would be greatly appreciated
  8. i dont know anything about server side scripting. how would i go about it? btw - the only data stored in the main database will be jpeg pictures. obvioulsy i will need a database with the username/password and the name search but what do i need to do?
  9. i would like to create a website such as:http://www.weddingherald.com/where the user can enter a name in the box.the user would then be presented with a list of matching results.if the user then clicked onto one of the results they would be presented with a username/password box.once the verification has taken plce, they will be able to access the contentwhat would be the best database type in order to achieve this and how would i go about creating it.also, is there any other languages (asp, ado etc) that i would need to achive the goal and if so how would i go about it?thanks in advance
  10. anybody else got any ideas?
  11. how can i get the information inputted into a form to be sent as an email (to myself) and then have a confirmation email sent to the person who inputted the info?
  12. im trying to update an existing record.
  13. do you think it is because im am missing an INSERT command in the SQL? if so where would i put the INSERT command and what would it replace?
  14. sorry i cant help u there im afraid!
  15. cool. its no problem. im grateful for your help. thanks
  16. ASPNETGUY have u managed to run those tests?maybe i should change the IF ELSE statements starting at where the SQL statements begin!
  17. yeah i have checked that. the DB is not readonly and the folder which contains the DB and the asp files has the 'everyone' group with full access
  18. sorry im a lil confused. can u talk me through exactly what i need to do step by step.
  19. this is the code for the ASP page (view.asp) which extracts all of the data from the table within the database:<%option explicit%><html><head><title>List Database Table</title></head><body><%dim conn,rs,xset conn=Server.CreateObject("ADODB.Connection") conn.provider="Microsoft.Jet.OLEDB.4.0"conn.open(server.mappath("disso1.mdb"))set rs=Server.CreateObject("ADODB.Recordset")rs.open "SELECT * FROM tblCustomer",conn%><h2>List Database Table</h2><p>Click on a button to modify a record.</p><table border="1" width="100%"><tr bgcolor="#b0c4de"><%for each x in rs.Fields response.write("<th>" & ucase(x.name) & "</th>")next%></tr><%do until rs.EOF%><tr bgcolor="#f0f0f0"><form method="post" action="demo_db_edit.asp" target="_blank"><%for each x in rs.Fields if x.name="CustomerID" then%> <td><input type="submit" name="CustomerID" value="<%=x.value%>"></td> <%else%> <td><%Response.Write(x.value)%> </td> <%end ifnext%></form><%rs.MoveNext%></tr><%looprs.closeset rs=nothingconn.closeset conn=nothing%></table></body></html>view.asp also creates buttons for the unique identifiers(customerid) for each record. if i click on any of these buttons i am presented with demo_db_edit.asp:<%CustomerID=Request.Form("CustomerID")if CustomerID="" then response.endset conn=Server.CreateObject("ADODB.Connection") conn.provider="Microsoft.Jet.OLEDB.4.0"conn.open(server.mappath("disso1.mdb"))set rs = Server.CreateObject("ADODB.Recordset")rs.Open "Select * from tblCustomer where tblCustomer.[CustomerID]=" & CustomerID , conn%><html><head><title>Edit DataBase Table</title></head><body><h2>Edit Database Table</h2><form method="post" action="demo_db_submit.asp" target="_blank"><input name="CustomerID" type="hidden" value=<%=CustomerID%>><table bgcolor="#b0c4de"><%for each x in rs.Fields if x.name <> "no" and x.name <> "dateadded" then%> <tr> <td><%=x.name%> </td> <td><input name="<%=x.name%>" value="<%=x.value%>" size="20"></td> <%end ifnextrs.closeconn.close%></tr></table><br /><input type="submit" name="action" value="Save"><input type="submit" name="action" value="Delete"></form></body></html>this page allows me to edit the data for the selected record. i am also presented with a SAVE button and a DELETE button. each of those buttons should either delete or save the data from/into the database. this is done via demo_db_submit.asp:<html><head><title>Submit DataBase</title></head><body><h2>Submit to Database</h2><%on error resume nextset conn=Server.CreateObject("ADODB.Connection") conn.provider="Microsoft.Jet.OLEDB.4.0"conn.open(server.mappath("disso1.mdb"))if Request.form("action")="Save" then CustomerID=Request.Form("CustomerID") sql="UPDATE tblCustomer SET CustomerID="' & Request.Form("CustomerID") & "'," sql=sql & "Last_Name='" & Request.Form("Last_Name") & "'," sql=sql & "First_Name='" & Request.Form("First_Name") & "'," sql=sql & "Address1='" & Request.Form("Address1") & "'," sql=sql & "Address2='" & Request.Form("Address2") & "'," sql=sql & "Address3='" & Request.Form("Address3") & "'," sql=sql & "Post_Code='" & Request.Form("Post_Code") & "'," sql=sql & "Telephone1='" & Request.Form("Telephone1") & "'," sql=sql & "Telephone2='" & Request.Form("Telephone2") & "' " WHERE tblCustomer.[CustomerID]=" & CustomerID "' Response.Write(sql)' Response.Write(" yuppy, we did it! ")' else ' Response.Write("Record number " & CustomerID & " was updated.")' end if Response.Write("Submitting records has been disabled from this demo")end ifif Request.Form("action")="Delete" then CustomerID=Request.Form("CustomerID")' conn.Execute "DELETE FROM tblCustomer WHERE tblCustomer.[CustomerID]=" & CustomerID, Recordsaffected' if err <> 0 then' Response.Write("You do not have permission to delete a record from this database!")' else ' Response.Write("Record number " & no & " was deleted.")' end if Response.Write("Deleting records has been disabled from this demo")end ifconn.close%></body></html>however, when i click on either the SAVE or DELETE button, i am presented with the message saying that i am not able to submit data etc and there is no action taken with regard to the database.
×
×
  • Create New...