I am writing an inquiry, which asks user to enter 4 fields<BR><BR>a. Routing number<BR>b. Account Number<BR>c. Date of transaction<BR>d. Amount<BR><BR><BR>After the items are entered an ASP page will then query the item by Routing number, account number, date and amount in the transactionlog table . I created a stored procedure that will be called and the 4 things are submitted to it. The stored procedure will then query out the item and return the company name,, merchant URL, customer service phone number and customer service e-mail from the merchantprofile table. The merchantID is a sufficient join between the two tables. <BR><BR>I Then display the returned fields to the user. Also if no transaction match occurs I intend to display the “closest record” with respect to date of transaction or amount entered. <BR><BR>I am new to this and have been trying for quiet a long time to figure this out .. but couldn’t go through ... please tell me where I am wrong and what needs to be corrected?<BR>My stored procedure and ASP page that I am using are below.. any help in this regard is highly appreciated..<BR>Thanks in advance.<BR><BR><BR>My stored Procedure:<BR><BR>CREATE PROCEDURE customerinquiry<BR>(<BR>@BankRoutingNumber varchar(30),<BR>@BankAccountingNumber varchar(30),<BR>@Amount money,<BR>@EffectiveEntryDate datetime<BR> )<BR> AS<BR><BR>SELECT Name,MerchantURL,CustomerServiceEmailAddress,Custo merServicePhoneNumber <BR>FROM MerchantProfile Where merchantID IN(SELECT merchantID FROM TransactionLog WHERE BankRoutingNumber=@BankRoutingNumber AND BankAccountingNumber=@BankAccountingNumber AND Amount=@Amount AND EffectiveEntryDate=@EffectiveEntryDate)<BR><BR><BR ><BR>ASP Page that calls stored procedure:<BR><BR>&#060;%<BR>dim BankRoutingNumber, BankAccoutningNumber, Amount, EffectiveEntryDate<BR><BR>BankRoutingNumber = Request.Form( " BankRoutingNumber " )<BR>BankAccoutningNumber = Request.Form( " BankAccountingNumber " )<BR>Amount= Request.Form( " Amount " )<BR>EffectiveEntryDate = Request.Form( " EffectiveEntryDate " )<BR><BR><BR>dim cmd<BR>dim conn<BR>dim rs<BR><BR>Set conn = server.createobject("ADODB.Connection")<BR>Set cmd = server.createobject("ADODB.Command")<BR>conn.open (my connection string)<BR><BR>cmd.CommandType = adcmdStoredProc<BR>cmd.ActiveConnection = conn <BR>cmd.CommadText = "customerinquiry"<BR>cmd.Parameters.Append<BR>cmd. Createparameter("@Name",adVarChar,adParamInput)<BR >cmd.Parameters.Append<BR>cmd.Createparameter("@Cu stomerServiceEmailAddress",adVarChar,adParamInput) <BR>cmd.Parameters.Append<BR>cmd.Createparameter(" @CustomerServicePhoneNumber",adVarChar,adParamInpu t)<BR>cmd.Parameters.Append<BR>cmd.Createparameter ("@MerchantURL",adVarChar,adParamInput)<BR><BR> Set rs = cmd.Execute<BR><BR>Response.Write "&#060;TABLE BORDER=0 CELLSPACING=1&#062;"<BR><BR>&#039;Display table headings for each column in the Recordset<BR>Dim objField<BR>Response.Write "&#060;TR&#062;" & vbNewLine<BR>For Each objField in rs.Fields<BR> Response.Write "&#060;TH&#062;" & objField.Name & "&#060;/TH&#062;" & vbNewLine<BR>Next<BR>Response.Write "&#060;/TR&#062;" & vbNewLine<BR><BR>&#039;Now, loop through the recordset, displaying TR/TD tags<BR>Do While Not objRS.EOF<BR> &#039;Write the TR<BR> Response.Write "&#060;TR&#062;" & vbNewLine<BR><BR> &#039;Now loop through the recordset Fields<BR> For Each objField in rs.Fields<BR> Response.Write "&#060;TD&#062;" & objField.Value & "&#060;/TD&#062;" & vbNewLine<BR> Next<BR><BR> &#039;Close the TR tag<BR> Response.Write "&#060;/TR&#062;" & vbNewLine<BR><BR> &#039;Advance the recordset<BR> objRS.MoveNext<BR>Loop<BR><BR>&#039;Close the table tag...<BR>Response.Write "&#060;/TABLE&#062;" & vbNewLine<BR><BR><BR>rs.close<BR> set rs = nothing<BR> DBC.Close<BR> set DBC = nothing<BR><BR>%&#062;