Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations sizbut on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

[Microsoft][ODBC Microsoft Access Driver] Too few parameters. Expected

Status
Not open for further replies.

obryant32

IS-IT--Management
Feb 20, 2003
66
US
Can someone please help me out with the error I'm getting in the subject of this thread? I'm trying to loop into an Access database and pull out a recordset based on a parameter that is selected from a dropdown Form. Here's the code:
<!---------------------------------------------------------------------------------------------------------------------->
Sub writeBranchInfo()

Dim objConnInfo, objRS, Query

Set objConnInfo = Server.CreateObject("ADODB.Connection")

Set objRS = Server.CreateObject("ADODB.Recordset")

theTeam=Request.Querystring("id")




objConnInfo_Open "branch","",""


Query = "Select id, Branch_Name, Branch_Address, Branch_City, Branch_State, Branch_Zip, Branch_Phone, Branch_Fax, Branch_Website, Owner_Name from branch where branch.id = '" & theTeam & "' order by rank"
objRS.Open Query, objConnInfo

%>

<TABLE border="0" align="right" valign="bottom" CELLPADDING="0" CELLSPACING="0">


<%DO UNTIL objRS.eof%>


<TR><TD><IMG SRC="../images/grayPix.gif" width="200" height="1" BORDER=0></TD></TR>
<TR><TD class="empTitletBold"><%=objRS("Branch_Name")%></TD></TR>
<TR><TD class="empInfo"><%=objRS("Branch_Address")%></TD></TR>
<TR><TD class="empInfo"><%=objRS("Branch_City")%>, <%=objRS("Branch_State")%> <%=objRS("Branch_Zip")%></TD></TR>


<TR><TD class="empInfo">Phone: <%=objRS("Branch_Phone")%></TD></TR>
<TR><TD class="empInfo">Fax: <%=objRS("Branch_Fax")%></TD></TR>
<TR><TD class="empInfo"><A CLASS="empEmail" HREF=<%=objRS("Branch_website")%></A></TD></TR>

<TR><TD><IMG SRC="../images/clearPix.gif" width="1" height="10" BORDER=0></TD></TR>

<%
objRS.movenext
LOOP
%>
</TABLE>
<%

objConnInfo.Close

Set objConnInfo = Nothing
Set objRS = Nothing

End Sub

Thanks so much,
Matt
 
how about wrapping the id in square brackets...

Query1 = "Select Owner_name from Branch where Branch.[id] = " & theBranch & " "

any help??

-DNG
 
is this by any chance a possibility in your case...

Code:
If you have been copy and pasting field names etc. make sure that you have not inadvertently copied any white space before or after the name.

-DNG
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top