: : : : I was on before trying to retrieve data from a table. My error was "type mismatch in expression". I checked and corrected the errors that I had but was left with this error. I was told that it had to do with the way my field was defined in the table, not as Text but as a Memo, for the size. I changed the data type per Access Help to 'OLE Object' but the query still will not work.
: : : :
: : : : My question:
: : : : I want to retrieve the data from a table, put it in a form to be emailed. How can I do this? I have been trying just the old run a query to parse the form fields but it is not working.
: : : :
: : : : Any help would be appreciated.
: : : : AB
: : : :
: : :
: : :
: : :
http://www.aspfaqs.com/aspfaqs/ShowFAQ.asp?FAQID=138
: : :
: : : If you still have the error,can we see the query you are using and a bit of the code?
: : :
: : Thanks and I made sure that the Letter was the last in the query, it is also the last in the join also.
: :
: : Here is a code example - should I read it into a certain kind of field or space?
: :
: : <%@ Language=VBScript %>
: : <HTML>
: : <HEAD>
: : <%
: : Dim strConnection
: : Dim Conn
: : Dim RSobj
: : Dim strSql
: : Dim filePath
: :
: :
: : filePath = Server.MapPath("information.mdb")
: : Set Conn = Server.CreateObject("ADODB.Connection")
: : Conn.Open "Provider=Microsoft.Jet.OLEDB.4.0;Data Source =" & filePath
: : Set RSobj = Conn.Execute("SELECT a.InterestChecked,a.BillNumber,a.BillTitle,Prefix,r.FirstName,r.MiddleName,r.LastName," & _
: : "Suffix,r.Address,r.City,r.State,r.PostalCode,FullName,Title,Nickname,Organization,c.Address,c.City," & _
: : "c.State,c.PostalCode,s.Letter FROM Bill_Information a,Registration r,Contact c, Sample_Letters s " & _
: : "WHERE a.InterestChecked = r.InterestChecked AND r.InterestChecked = c.InterestChecked AND c.InterestChecked = " & _
: : "s.InterestChecked AND a.InterestChecked = 1")
: :
: :
: : %>
: : <meta name="GENERATOR" Content="Microsoft Visual Studio .NET 7.1">
: : </HEAD>
: : <body ms_positioning="GridLayout">
: : <TABLE height="559" cellSpacing="0" cellPadding="0" width="488" border="0" ms_2d_layout="TRUE">
: : <TR vAlign="top">
: : <TD width="10" height="15"></TD>
: : <TD width="53"></TD>
: : <TD width="1"></TD>
: : <TD width="424"></TD>
: : </TR>
: : <TR vAlign="top">
: : <TD height="17"></TD>
: : <TD rowSpan="2">
: : <%
: :
RSobj.Close
: : Conn.close
: : %>
: : </TD>
: : <TD colSpan="2"></TD>
: : </TR>
: : <TR vAlign="top">
: : <TD height="64"></TD>
: : <TD colSpan="2">
: : <DIV ms_positioning="FlowLayout">
: : <TABLE height="48" cellSpacing="0" cellPadding="0" width="192" border="0" ms_1d_layout="TRUE">
: : <TR>
: : <TD>
: : <%=RSobj("Prefix").Value%>
: : <%=RSobj("r.FirstName").Value%>
: : <%=RSobj("r.MiddleName").Value%>
: : <%=RSobj("r.LastName").Value%>
: : <%=RSobj("Suffix").Value%>
: : <%=RSobj("r.Address").Value%>
: : <%=RSobj("r.City").Value%>
: : <%=Response.Write(", ")%>
: : <%=RSobj("r.State").Value%>
: : <%=RSobj("r.PostalCode").Value%>
: : </TD>
: : </TR>
: : </TABLE>
: : </DIV>
: : </TD>
: : </TR>
: : <TR vAlign="top">
: : <TD colSpan="2" height="64"></TD>
: : <TD colSpan="2">
: : <DIV ms_positioning="FlowLayout" id="DIV1">
: : <TABLE height="24" cellSpacing="0" cellPadding="0" width="168" border="0" ms_1d_layout="TRUE">
: : <TR>
: : <TD><%=RSobj("FullName").Value%>
: : <%=RSobj("Title").Value%>
: : <%=RSobj("Nickname").Value%>
: : <%=RSobj("Organization").Value%>
: : <%=RSobj("c.Address").Value%>
: : <%=RSobj("c.City").Value%>
: : <%=RSobj("c.State").Value%>
: : <%=RSobj("c.PostalCode").Value%></TD>
: : </TR>
: : </TABLE>
: : </DIV>
: : </TD>
: : </TR>
: : <TR vAlign="top">
: : <TD colSpan="2" height="336"></TD>
: : <TD colSpan="2">
: : <DIV ms_positioning="FlowLayout" id="DIV2">
: : <TABLE height="304" cellSpacing="0" cellPadding="0" width="424" border="0" ms_1d_layout="TRUE">
: : <TR>
: : <TD><%=RSobj("Letter").Value%></TD>
: : </TR>
: : </TABLE>
: :
:
:
: Why are you closing the recorset there ? remove those lines and lets take it from there.
:
Sorry, that's me changing things up. Done and same error.