Jump to content

error when trying to write record set


mckenzie

Recommended Posts

<%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?

Link to comment
Share on other sites

change

SQL = "select id, telephonenumber, address from contacts"

to

SQL = "select * from contacts"

do you still get the error? If not it is either becuase one of the fields you were calling don't exist (possibly a typo) or one of them is a 'keyword' most likely id or address. try inclosing them (one at a time to make sure you need to) in [] (eg. [id])

Link to comment
Share on other sites

yes it did. I just wanted you to use it to make sure it was a problem with the fields you were trying to select, which we now know was the case. What is the structure of the contacts table??? Please list the fields (careful no typos :))

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...