Jump to content

mckenzie

Members
  • Posts

    54
  • Joined

  • Last visited

Everything posted by mckenzie

  1. sorry to bother any of u but does anyone know of some examples on how a dropdown box/form can access records from a database. looked at the examples and can't seem to find any. it mite be me being blind. 2 goldfish in a tankone says to the other "how do you drive this thing"
  2. i've heard you can put into a database a symbol within the text and then implement a loop to insert a pic from the database when it finds the symbol. something like dim textarray, maxrecordtextarray = split(rs("bodytext"), "*/")maxrecord = ubound(textarray)if maxrecord >= i then Response.write "<p>" & replace(textarray(i), vbcrlf, "<br>") & "</p>" end if%>How will i be able to implement this into my code?heres my code<%'create a connection objectdim connset conn = server.CreateObject ("ADODB.connection")Conn.Open "PROVIDER=Microsoft.Jet.OLEDB.4.0;DATA SOURCE="& server.mappath("WildlifeMag.mdb")&";"'create a recordsetDim SQLSQL = "select * from features where ID=" & request("id") & " order by ID"set RS = Conn.execute(SQL)%><html><head><title>New Page 1</title></head><body bgcolor="#FFFFCC"><table border="0" width="780" cellspacing="0" cellpadding="0" height="476"> <tr> <td colspan="3" valign="top" width="774" height="89"><!--#include virtual="/cmpweb10/mckenzie/includes/masthead.asp"--></td> </tr> <tr> <td colspan="3" width="774" height="1"></td> </tr> <tr> <td width="194" valign="top" height="442"><!--#include virtual="/cmpweb10/mckenzie/includes/leftnav.asp"--></td><!--end nav bar--> <td width="482" valign="top" align="center" height="442"> <td width="565" valign="top"> <table width="564" height ="390" border="0" cellpadding ="10" cellspacing="0"> <tr> <td colspan="2" align="center" class="style3">click on any thumbnail image to see the larger version</td> </tr> <tr> <% dim i i=1 do while not RS.eof%> <td align="center"><p><a href="/featureview.asp?ID=<%=RS("ID")%>"><img border="0" src="/cmpweb10/mckenzie/images/<%=RS("image1") %>"width="80" height="57"></a></p> <%=RS("Main Body")%> <% RS.movenext i = i+1 if i > 2 then response.Write "</td><td>" i=1 end if loop%> </tr> </table></td> </td> <td width="90" valign="top" height="442"><!--#include virtual="/cmpweb10/mckenzie/includes/rightbar.asp"--></td></tr></table></body></html>
  3. its access and how would i go about setting the database to accept null
  4. i think it worked.dim conn sql=insert into feedback(lastname, firstname, email, telephone, age, ######, helpfullness, appeal, use, quality, suggestions, focus, history, hair, triathlon, koiPondsGardens, subscribe)values('','','e-mail','',, '','-','-','-','-','',false, false, false, false, false, true)it provided this information!sorry i'm a newbie i'm jus gonna check my database
  5. this error occurs when trying to write to a database!Syntax error in INSERT INTO statementheres the code:<!--#include file="includes/head.asp"--><table width="700" cellpadding="4" cellspacing="4" border="1" align="left" class="text2"> <!--#include file="includes/masthead.asp"--> <tr> <td width="150" valign="top"> <!--------left navi bar--------> <!--#include file="includes/left_navi.asp"--> <td width="0" valign="top"> <!--------Central Content--------><% dim conn set conn = Server.CreateObject("ADODB.connection") conn.Open "PROVIDER=Microsoft.jet.oledb.4.0;DATA SOURCE=" & server.MapPath("Features.mdb") & ";" dim id id = request("id") dim sql 'step 1 - make sql statement Sql = "insert into feedback(lastname, firstname, email, telephone, age, ######, helpfullness, appeal, use, quality, suggestions, focus, history, hair, triathlon, koiPondsGardens, subscribe)" Sql = Sql & "values('" & request("lname") & "'," Sql = Sql & "'" & request("fname") & "'," Sql = Sql & "'" & request("email") & "'," Sql = Sql & "'" & request("tel") & "'," Sql = Sql & request("age") & ", " Sql = Sql & "'" & request("######") & "'," Sql = Sql & "'" & request("helpfulness") & "'," Sql = Sql & "'" & request("visual_appeal") & "'," Sql = Sql & "'" & request("use") & "'," Sql = Sql & "'" & request("quality") & "'," Sql = Sql & "'" & request("suggestions") & "'," 'loop through the 5 magazines to add them into the database for i = 1 to 5 if request("magazine"&i) = "1" then Sql = Sql & "true, " else Sql = Sql & "false, " end if next 'check that the subscribe checkbox was checked if request("intColumn2") = "1" then Sql = Sql & "true) " else Sql = Sql & "false) " end if response.write "sql=" & sql conn.execute(sql) %> <table width="400" cellpadding="10" cellspacing="10" border="0" align="left" class="text3"> <tr> <td align="center"><h2>THANKYOU FOR YOUR CONTRIBUTION!</h2><br><br></td> </tr> <tr> <td align="center"><h3>Your Comments will be examined carefully</h3></td> </tr> <tr> <td align="center" class="text1"><h4>Click <a href="default.asp" title="Home Page"><b>here</b></a> to return to the Home Page</<h4></td> </tr> </table> <td width = "140" valign="top"></td> <!--End Central Content--> <!--------Affiliates--------> <!--#include file="includes/Affil.asp"--> <td width="15" valign="top"></table>
  6. You absolute legend. I'm in the classroom now and everyone has started chanting your name. might be back in a bit to ask another couple of questions. did that statement select all the fields in the table?
  7. <%set Conn = Server.createobject("ADODB.Connection")conn.open "PROVIDER=Microsoft.jet.OLEDB.4.0;DATA SOURCE=" & server.mappath("WildlifeMag.mdb") &";"dim sqlSQL = "select id, telephonenumber, address from contacts"set RS = Conn.execute(SQL)%><html><head><title>Wildlife.com</title></head><body bgcolor="#FFFFCC"><table border="1" width="780" cellspacing="0" cellpadding="0" height="476"> <tr> <td colspan="3" valign="top" width="774" height="89"><!--#include virtual="/cmpweb10/mckenzie/includes/masthead.asp"--></td> </tr> <tr> <td width="194" valign="top" height="442"><!--#include virtual="/cmpweb10/mckenzie/includes/leftnav.asp"--></td><!--end nav bar--> <td width="482" valign="top" height="442"> <!-- index here--> <%do while not RS.eof%> <p class="heading">%>"><%=rs("telephonenumber")%></a></p> <p class="normaltext"><%=rs("address")%></p> <%RS.movenext loop%> <!-- index here--> </td> <td width="90" valign="top" height="442"><!--#include virtual="/cmpweb10/mckenzie/includes/rightbar.asp"--></td></tr></table></body></html><% conn.Close%>not sure of the need for the ID number as i'm not looping the data of anything fancie like that?
  8. this error appears and i'm kinda stumped onwhat it means. Microsoft JET Database Engine (0x80040E10)No value given for one or more required parameters.it highlights line 7.line 7=set RS = Conn.execute(SQL) i'm jus a newbie
  9. I'm trying to obtain any access database connected asp examples and couldn't seem to find any. I'm connecting to the database and have created a recordset. I now need to populate my page with the images and text i get from my database. If anbody has any examples or information on this?
×
×
  • Create New...