Results 1 to 4 of 4

Thread: .Execute error - help!

  1. #1
    New Member
    Join Date
    Mar 04
    Posts
    2

    Smile .Execute error - help!

    Hello,

    I'm writing a VB program to move data from Access to a file in a specific format. I keep encountering an error that I can't seem to figure out. The error is "No value given for one or more required parameters". I get this error for the following line of code:

    Set MyBudgetSet = MyConn.Execute("Select * from BudgetItem where ProjectNumber = " & Chr(145) & strProject & Chr(146))

    The whole program is attached. Any and all help is appreciated. I'm stumped.

    Thanks!!!
    Attached Files Attached Files

  2. #2
    Hyperactive Member
    Join Date
    Nov 99
    Location
    Leavenworth KS USA
    Posts
    482
    FWIW, 145 & 146 are a good way to circumvent the problems created by passing
    word quotes or apostrophes into database objects, but not for delimiting string
    values.

    Assuming ProjectNumber is a char/varchar datatype, only ASCII characters 34 and 39
    can act as string delimiters, otherwise you should omit them with a numeric datatype.

  3. #3
    New Member
    Join Date
    Mar 04
    Posts
    2

    still not working...

    Thanks, I changed it from chr(145) and chr(146) to chr(39), but I'm still encountering the same error with the same line of code. I've made other changes to my program and have attached it. Any idea why i'm getting the error?

    Thanks again!!
    Attached Files Attached Files

  4. #4
    PowerPoster Pasvorto's Avatar
    Join Date
    Oct 02
    Location
    Minnesota, USA
    Posts
    2,938
    Doesn't the whole SELECT statement hasve to be in quotes when using the EXECUTE method?

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •