2 Replies - 7815 Views - Last Post: 27 February 2011 - 01:04 AM Rate Topic: -----

#1 Tareshukla  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 8
  • Joined: 26-February 11

Run Time Error 2147217904 - No value given for one or more parameters

Posted 26 February 2011 - 04:18 AM

temp = CInt(Text1.Text)
MsgBox temp

SQL1 = "SELECT * FROM SecurityData WHERE ramt>temp"


RS.Open SQL1, CN, adOpenStatic, adLockReadOnly, adCmdText

Actually I want to pass the value from text box to temp and temp value will be passed to SQL1

After execution of above code, I am getting err
"Run Time Error 2147217904 - No value given for one or more parameters"
Is This A Good Question/Topic? 0
  • +

Replies To: Run Time Error 2147217904 - No value given for one or more parameters

#2 maj3091  Icon User is offline

  • D.I.C Lover
  • member icon

Reputation: 328
  • View blog
  • Posts: 1,990
  • Joined: 26-March 09

Re: Run Time Error 2147217904 - No value given for one or more parameters

Posted 26 February 2011 - 04:52 AM

Your SQL query is using temp as the parameter as opposed to the value of temp.

Maybe you could change it to be something like:

SQL1 = "SELECT * FROM SecurityData WHERE ramt > " & cstr(temp) 

Was This Post Helpful? 0
  • +
  • -

#3 BobRodes  Icon User is offline

  • Lovable Curmudgeon
  • member icon

Reputation: 600
  • View blog
  • Posts: 3,069
  • Joined: 19-May 09

Re: Run Time Error 2147217904 - No value given for one or more parameters

Posted 27 February 2011 - 01:04 AM

The trick is to visualize what your SQL string will look like. A good way to do that is to use MsgBox as you have, or say Debug.Print and look at what gets printed. You need to think about "plugging in" the value of your variable into the string variable.
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1