Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8208699
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 7, 20262026-06-07T09:28:01+00:00 2026-06-07T09:28:01+00:00

I am trying to get a paramterised query to work in asp classic. Any

  • 0

I am trying to get a paramterised query to work in asp classic. Any help appreciated
Here is the error

Microsoft OLE DB Provider for Visual FoxPro error ‘80040e14’
Missing operand.
/portal/jobportal/getaddress1.asp, line 141

function paramQuery()

code = ucase(request.querystring("code"))
stype = request.querystring("type")
cAddressType = request.querystring("caddresstype")


Set rs = Server.CreateObject("ADODB.recordset")
Set cmd = server.CreateObject("ADODB.Command")

If IsObject(Session("portal_conn")) Then
    Set conn = Session("portal_conn")
Else
    Set conn = Server.CreateObject("ADODB.Connection")
    cConnString = "Provider=vfpoledb;Data Source="+session("portaldata")+"portal.dbc" 
    conn.open cConnString,"",""
    Set Session("portal_conn") = conn
end if

cmd.ActiveConnection = conn
cmd.Prepared = true
cmd.CommandType = 1
cmd.CommandText =  "SELECT * from uaddress where userid = "+cstr(session("userid"))+" and upper(name) like ? + % "+" and type = '"+ trim(cAddresstype)+"' order by add1"

set param1 = cmd.CreateParameter("@name",200,2,40)
cmd.Parameters.append param1
cmd.Parameters("@name") = code
cmd.Execute() <-- missing operand error
rs.Open cmd

end function
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-07T09:28:04+00:00Added an answer on June 7, 2026 at 9:28 am

    When using parameter for SQL like clause you need to pass the % as part of the parameter value.

    Also to protect against SQL Injection attacks you really better use parameters for the other values as well:

    cmd.CommandText =  "SELECT * FROM uaddress WHERE userid=? AND UPPER(name) LIKE ? AND type=? ORDER BY add1"
    
    set param1 = cmd.CreateParameter("@id", 200, 2, 40)
    cmd.Parameters.append param1
    cmd.Parameters("@id") = cstr(session("userid"))
    
    set param2 = cmd.CreateParameter("@name", 200, 2, 40)
    cmd.Parameters.append param2
    cmd.Parameters("@name") = "%" & code & "%"
    
    set param3 = cmd.CreateParameter("@type", 200, 2, 40)
    cmd.Parameters.append param3
    cmd.Parameters("@type") = trim(cAddresstype)
    
    cmd.Execute()
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am trying get Struts 2 and Tiles to work and I am using
Trying to get a wildcard search to pick up on any text in org_name
Trying to get this expression to work, can someone look at it and tell
I was trying to to use parameterized query with data reader when I get
Hi am trying get GPS using network provider and GPS provider. but am getting
I am trying get the values using SP.The query is below. create proc [dbo].[GetOrdersByUserID11]
I am trying get Javascript popup calendar control to work which doesnt work. I
When trying to enter a SQL query with parameters using the Oracle OLE DB
Trying to get an autocomplete to work an a textbox but it seems that
I am trying get response from servlet use request.setAttribute(error, error); request.getRequestDispatcher(http://localhost:8080/redicted_test/Home.jsp).forward(request, response); String redictedURL=http://localhost:8080/redicted_test/Home.jsp;

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.