Jump to content

chrepair

Members
  • Posts

    20
  • Joined

  • Last visited

chrepair's Achievements

Newbie

Newbie (1/7)

0

Reputation

  1. Thank you once again!I did a little playing with the example you gave me to make this work. I "DIM" the da variable to (DATE()) on the page that posts and used your example that added the variable directly to the database. Then jsut put in the write.responce to display it on the page. I did not know i could directly insert a variable without any " or ( like that. So thanks again!Obviously I need to learn this programming or atleast want to....do you recommend and quick reference guides or books that I can buy that can explain this easily so that even a novice such as myself can understand it and get it working without forum help? I greatly appreciate all your help but i do feel bad continually bugging you with what appears to be trivial information should I have a book to learn from. I have and am learning tons of info from you and I again can't thank you enough!
  2. YOU DA MAN!!!That was the problem. When i first put the ' in front of the error code on the page, the page would not display at all. Then when i added the [] to date the page rendered and now it say "1" record added instead of just record added. When checked the record indeed did add to the data base. Good job thanks a bunch!For my next trick i want to make a form that deletes records and I am sure i will be contacting you about that.As far as formatting goes, if i follow CSS examples will that make things look how i want them to look code wise?Also with this add record page i would like a date to be inseted into the database as the first field and give the uer no option to change that when adding a record but not sure how to go about that one. So that when a users goes to the add page the first "date" field will display the current date(and time) and under that in the "new" field will be where you can type. I was playing with trying to have it auto insert the date but i think this code is written totally wrong for this type of add to database. I also tried formatting the actual database fields in access to a date format which just made the page error then. All my database fields are text as of now.any thoughts?
  3. Also I have emailed you private links to the actual forms on the pages if that will help.
  4. Cool.The page works and displays record added but no records have actually been added. There is no error this time though.What are your thoughts?
  5. Now i get this...The page cannot be displayed There is a problem with the page you are trying to reach and it cannot be displayed. I took out the error code but the page won't render at all. There is some kinda code problem somewhere.here is the code with that area removed. Must be a typo somewhere.<html><body><%set conn=Server.CreateObject("ADODB.Connection")conn.Provider="Microsoft.Jet.OLEDB.4.0"conn.Open "D:/Websites/Inetpub/Gregs/DBA2/northwind.mdb"sql="INSERT INTO greg (Date,New)"sql=sql & " VALUES "sql=sql & "('" & Request.Form("da") & "',"sql=sql & "'" & Request.Form("ne") & "')"on error resume nextconn.Execute sql,recaffected Response.Write("<h3>" & recaffected & " record added</h3>")end ifconn.close%></body></html> here is the page befrore it...<html><body><form method="post" action="dadd.asp"><table><tr><td>Date:</td><td><input name="da"></td></tr><tr><td>Type First Comment:</td><td><input name="ne"></td></tr><tr></tr><tr></table><br /><br /><input type="submit" value="Add New"> <input type="reset" value="Cancel"></form></body></html>any Idea's?
  6. chrepair

    permissions error

    hello again all.I am simply trying to insert a new record into my data base and keep getting some type of error.Here is the code for the first page...<html><body><form method="post" action="dadd.asp"><table><tr><td>Date:</td><td><input name="da"></td></tr><tr><td>Type First Comment:</td><td><input name="ne"></td></tr><tr></tr><tr></table><br /><br /><input type="submit" value="Add New"> <input type="reset" value="Cancel"></form></body></html>here is the code for the 2nd page...<html><body><%set conn=Server.CreateObject("ADODB.Connection")conn.Provider="Microsoft.Jet.OLEDB.4.0"conn.Open "DATABASEPATH.MDB" ---this is correct on my real pagesql="INSERT INTO greg (Date,New)"sql=sql & " VALUES "sql=sql & "('" & Request.Form("da") & "',"sql=sql & "'" & Request.Form("ne") & "')"on error resume nextconn.Execute sql,recaffectedif err<>3 then Response.Write("No update permissions!")else Response.Write("<h3>" & recaffected & " record added</h3>")end ifconn.close%></body></html>Simpel, right?I have other pages that access this same database and i can change records with no problems, so it's not a"no update permissions" error like I am getting with this code here. Can anyone tell me how to change this code so that I can get an accurate error report as to exactly what kind of error is happening? Also any clues why I am getting an error at all?thnaks.
  7. Hello all.I am using ASP and have a database and a page to display the data in the database.What I want to do is have my display page show the word "RESERVED" for fields in my database that have SOMETHING (words, letters, numbers, characters-etc) typed in them. For fields that are blank or have nothing in them I want the word "AVAILABLE" displayed on the page. Below is the code that I have for the display page.Any idea's?<meta http-equiv="refresh" content="30"> <html><style>#MainTable th{ width: 50px; color: #000099; font-size: 24; font-family:andy;}</style><style type="text/css"><!--.style1 { font-family: Georgia, "Times New Roman", Times, serif; font-size: 10px;}body { background-color: #000000;}--></style><%dim nameaval="AVAILABLE"%><body><%set conn=Server.CreateObject("ADODB.Connection")conn.Provider="Microsoft.Jet.OLEDB.4.0"conn.Open(Server.Mappath("northwind.mdb"))set rs = Server.CreateObject("ADODB.recordset")sql="SELECT Time, Monday, Tuesday, Wednesday, Thursday, Friday, Saturday, Sunday FROM greg"rs.Open sql, conn%><table id="MainTable" width="750" height="20" border="2" align="center" cellpadding="0" bordercolor="#0000FF" bgcolor="#00FFFF"><tr><%for each x in rs.Fields response.write("<th align='center' bgcolor='#00CCFF' font-family:andy>" & x.name & "</th>")next%></tr><%do until rs.EOF%> <tr> <%for each x in rs.Fieldsif x.name = "Time" then%><td align="center" valign="middle" style="background-color:#000099;font-family:Andy;color:#FFFF00;font-size:15pt;font-weight:bold;border:1px solid #666666"><%else%><td align="center" valign="middle" style="background-color:#66FFFF;font-family:Georgia;color:#663300;font-size:12pt;font-weight:normal;border:1px solid #666666"> <span class="style1"><%end if%><%Response.Write(x.value)%></div> </span> <div align="center"></div></td><%next rs.MoveNext%> </tr><%looprs.closeconn.close%></table></body></html>
  8. I am not all that familiar with what this is actually doing.I made the changes and now I am getting that pre-defined error in the code "No update permissions".Not sure what is up now?CORRECTION: I GOT IT!! YEAH!!!!I had to add 1 more line to it and now it works.sql=sql & "Saturday='" & Request.Form("saturday") & "'," sql=sql & "Sunday='" & Request.Form("sunday") & "'" sql=sql & " WHERE time='" & cid & "'"Question, in this code how do I make the display show up as AVAILABLE if a field is blank in the database and if there is ANYTHING written in a field the display page will show RESERVED?Here is the code (it should look familiar as we wrre working on it before):<meta http-equiv="refresh" content="30"> <html><style>#MainTable th{ width: 50px; color: #000099; font-size: 24; font-family:andy;}</style><style type="text/css"><!--.style1 { font-family: Georgia, "Times New Roman", Times, serif; font-size: 10px;}body { background-color: #000000;}--></style><%dim nameaval="AVAILABLE"%><body><%set conn=Server.CreateObject("ADODB.Connection")conn.Provider="Microsoft.Jet.OLEDB.4.0"conn.Open(Server.Mappath("northwind.mdb"))set rs = Server.CreateObject("ADODB.recordset")sql="SELECT Time, Monday, Tuesday, Wednesday, Thursday, Friday, Saturday, Sunday FROM greg"rs.Open sql, conn%><table id="MainTable" width="750" height="20" border="2" align="center" cellpadding="0" bordercolor="#0000FF" bgcolor="#00FFFF"><tr><%for each x in rs.Fields response.write("<th align='center' bgcolor='#00CCFF' font-family:andy>" & x.name & "</th>")next%></tr><%do until rs.EOF%> <tr> <%for each x in rs.Fieldsif x.name = "Time" then%><td align="center" valign="middle" style="background-color:#000099;font-family:Andy;color:#FFFF00;font-size:15pt;font-weight:bold;border:1px solid #666666"><%else%><td align="center" valign="middle" style="background-color:#66FFFF;font-family:Georgia;color:#663300;font-size:12pt;font-weight:normal;border:1px solid #666666"> <span class="style1"><%end if%><%Response.Write(x.value)%></div> </span> <div align="center"></div></td><%next rs.MoveNext%> </tr><%looprs.closeconn.close%></table></body></html>
  9. I made an update page from the examples on this site(ASP UPDATE) and changed the code to match the field names in my database. I have a ASP page that displays all data in my data base and that works perfectly. This new update page I made from the ASP UPDATE EXAMPLE displays the DB data and in the first field there is a button to press so u can change that line's data. That works and when u press the button the next page appears with all teh fields in that row. I change the data in one of the fields, hit update and then the page changes and says congradulations "field name" was successfully updated, but, in reality the database reflects NO changes. Any idea's why this is happening? I get no errors but nothing changes in te database.PLEASE HELP AS THIS IS DRIVING ME CRAZY!Here is the code on the UPDATE.asp page:<html><body><%set conn=Server.CreateObject("ADODB.Connection")conn.Provider="Microsoft.Jet.OLEDB.4.0"conn.Open "northwind.mdb"set rs=Server.CreateObject("ADODB.Recordset")rs.open "SELECT * FROM greg",conn%><table border="1" width="75%"><tr><%for each x in rs.Fields response.write("<th>" & ucase(x.name) & "</th>")next%></tr><% do until rs.EOF %><tr><form method="post" action="demo_update.asp"><%for each x in rs.Fields if lcase(x.name)="time" then%> <td> <div align="left"> <input type="submit" name="time" value="<%=x.value%>"> </div></td> <%else%> <td><%Response.Write(x.value)%> <div align="center"></div></td> <%end ifnext%></form><%rs.MoveNext%></tr><%loopconn.close%></table><FORM> <div align="center"> <INPUT TYPE="button" VALUE="Back" onClick="history.go(-2);return true;"> </div> </FORM></body></html>HERE IS THE CODE ON THE UPDATE_DEMO.ASP page:<html><body><h2>Update Record</h2><%set conn=Server.CreateObject("ADODB.Connection")conn.Provider="Microsoft.Jet.OLEDB.4.0"conn.Open "northwind.mdb"cid=Request.Form("time")if Request.form("monday")="" then set rs=Server.CreateObject("ADODB.Recordset") rs.open "SELECT * FROM greg WHERE time='" & cid & "'",conn %> <form method="post" action="demo_update.asp"> <table> <%for each x in rs.Fields%> <tr> <td><%=x.name%></td> <td><input name="<%=x.name%>" value="<%=x.value%>"></td> <%next%> </tr> </table> <br /><br /> <input type="submit" value="Update record"> </form><%else sql="UPDATE greg SET " sql=sql & "Monday='" & Request.Form("Monday") & "'," sql=sql & "Tuesday='" & Request.Form("tuesday") & "'," sql=sql & "Wednesday='" & Request.Form("wednesday") & "'," sql=sql & "Thursday='" & Request.Form("thursday") & "'," sql=sql & "Friday='" & Request.Form("friday") & "'," sql=sql & "Saturday='" & Request.Form("saturday") & "'" sql=sql & " WHERE Sunday='" & time & "'" on error resume next conn.Execute sql if err<>0 then response.write("No update permissions!") else response.write("Record " & cid & " was updated!") end if end ifconn.close%></body><FORM> <INPUT TYPE="button" VALUE="Back" onClick="history.go(-2);return true;"> </div> </FORM></html>ANY IDEAS?
  10. Some thing new has appeared.The update page creation is successful, and i get no errors, but no data is updated in my database.The page returns to tell me that the record was successfully updated after submission.So now what?Any idea's?
  11. Totally lost me on this one. I attempted to make a page and put this code in it but I am not really sure where to put the java at and where to put the html at? All on the same page right? From what I could see if the page it is displaying file attributes and things. I jsut need something to pose the checked results to the database. Also only 1 check box per column will be allowed to be checked and will change accordingly if mutiple check boxes are attempted. I am not exactly sure what the code is for that but I am working on it.Any idea's?
  12. Actually, maybe i should just ask you first before attempting this....I want to make a series of check boxes for the update info.....going from top to bottom starting at the left i am gonig to put time and have each time starting from 10:00 am to 10:00 pm in 30 min incraments as check boxes, then in the middle of the page going from top to bottom I am putting a check box for each day of the week, and then on the right I am going to have 3 check boxes- one for a preset word of "AVAILABLE", another for a preset word of "RESERVED: and one more for whatever a user wants to input of say 10 characters. All the check boxes in the colums will not allow multiple check bozes to be checked except that each gategory (Time, day, other) across the top will have 1 Check all check box that will check everything in that colum. There will be a clear all and submit button at the bottom. How would you suppose the easiest way to achieve this would be possible? This might be askin to much of ya but any thoughts are most appreciated!
  13. Once again you have proven 100% perfection. That is exactly what I needed. I think the form is now complete. Next I am going to play with an update page. I am sure you will be hearing from me.Thanks again. I bow down to your infamous wisdom!Actually, maybe i should just ask you first before attempting this....I want to make a series of check boxes for the update info.....going from top to bottom starting at the left i am gonig to put time and have each time starting from 10:00 am to 10:00 pm in 30 min incraments as check boxes, then in the middle of the page going from top to bottom I am putting a check box for each day of the week, and then on the right I am going to have 3 check boxes- one for a preset word of "AVAILABLE", another for a preset word of "RESERVED: and one more for whatever a user wants to input of say 10 characters. All the check boxes in the colums will not allow multiple check bozes to be checked except that each gategory (Time, day, other) across the top will have 1 Check all check box that will check everything in that colum. There will be a clear all and submit button at the bottom. How would you suppose the easiest way to achieve this would be possible? This might be askin to much of ya but any thoughts are most appreciated!
  14. ABSOLUTELY SUPERB!! LOOKS GREAT! You really got a sctrong handle on this. This forum should help alot of people.Ok, next question...how do I lock in the cell sizes. Example is the header "Wednesday" is bigger than "Friday" and therefore making the table bigger in spots. I tried locking down the pixel width and also the percentage field of the table but this appears to have no effect. Any idea's on this?I really appreciate you helpnig me out on this. I must be a real pain in the butt. So again, I really do appreciate this.
  15. Man you sure know you stuff.Ok, how about bolding this text?Is there a way to set the internal cell border colors and size? I know I can set the outer ring color and size but not sure about the inner cells as it makes them?Also, the headers at the top I want to change the color,size, bold, etc.....I tried to use the examples you gave for the body of this form but it errors when put in the top where the headers are. Any ideas?
×
×
  • Create New...