+ Reply to Thread
Results 1 to 6 of 6

Thread: incorrect syntax

  1. #1
    Barn Loyal todd2006 is an unknown quantity at this point todd2006's Avatar
    Join Date
    Mar 2008
    Posts
    889
    Rep Power
    4

    incorrect syntax

    Hi,

    Here is my asp code

    Code:
    set rs = Conn.execute("EXEC dbo.Get_Info @email=" &sentemail)
    
    passing a parameter to the stored procedure

    and here is the stored procedure

    Code:
    Create PROCEDURE [dbo].[Get_Info]
    @email varchar(5000)
    
    As
    Select * From dbo.Registration 
              where Email = @email
    

    it gives an error

    Incorrect syntax near '-'.

    and the error is on this line

    set rs = Conn.execute("EXEC dbo.Get_Info @email=" &sentemail)

    any idea

  2. #2
    Super Sarcasm Mistress mehere is a glorious beacon of light mehere is a glorious beacon of light mehere is a glorious beacon of light mehere is a glorious beacon of light mehere is a glorious beacon of light mehere's Avatar
    Join Date
    Mar 2008
    Location
    Wide Awake In Dreamland
    Posts
    830
    Rep Power
    8

    try this:
    Code:
    set rs = Conn.execute("EXEC dbo.Get_Info '" & sentemail & "'")
    
    Quote of the Month:
    INSIGHT: When the going gets tough, the tough get going. The smart left a long time ago.

    Questions to Ponder:
    Are people more violently opposed to fur rather than leather because it's much easier to harass rich women than motorcycle gangs?

    iif([sarcasm]=true,iif([you have to ask]=true,"didn't work","ha ha ha"),"not sarcasm")
    copyright © 2008 sbenj69

    Sarchasm: The gulf between the author of sarcastic wit and the person who doesn't get it.

  3. #3
    Barn Loyal todd2006 is an unknown quantity at this point todd2006's Avatar
    Join Date
    Mar 2008
    Posts
    889
    Rep Power
    4

    mehere,

    thanks it worked out but if i am passing two parameters how will my query be then

  4. #4
    Super Sarcasm Mistress mehere is a glorious beacon of light mehere is a glorious beacon of light mehere is a glorious beacon of light mehere is a glorious beacon of light mehere is a glorious beacon of light mehere's Avatar
    Join Date
    Mar 2008
    Location
    Wide Awake In Dreamland
    Posts
    830
    Rep Power
    8

    they should be separated by commas and in the same order as they are in your stored proc
    something like this:
    Code:
    set rs = Conn.execute("EXEC dbo.Get_Info '" & sentemail & "','" & username & "'")
    
    Quote of the Month:
    INSIGHT: When the going gets tough, the tough get going. The smart left a long time ago.

    Questions to Ponder:
    Are people more violently opposed to fur rather than leather because it's much easier to harass rich women than motorcycle gangs?

    iif([sarcasm]=true,iif([you have to ask]=true,"didn't work","ha ha ha"),"not sarcasm")
    copyright © 2008 sbenj69

    Sarchasm: The gulf between the author of sarcastic wit and the person who doesn't get it.

  5. #5
    Barn Loyal todd2006 is an unknown quantity at this point todd2006's Avatar
    Join Date
    Mar 2008
    Posts
    889
    Rep Power
    4

    you know that you are one smart girl in this forum.

    I have a small request since you are good with sql.

    Can you look at this post and tell me whats going wrong

    Top problem - SQL Development

    the output parameter is just not working

  6. #6
    Super Sarcasm Mistress mehere is a glorious beacon of light mehere is a glorious beacon of light mehere is a glorious beacon of light mehere is a glorious beacon of light mehere is a glorious beacon of light mehere's Avatar
    Join Date
    Mar 2008
    Location
    Wide Awake In Dreamland
    Posts
    830
    Rep Power
    8

    i've never done output parameters and i don't have sql server on this pc to test. let me see if i can find something and i'll let you know if i do in that thread.
    Quote of the Month:
    INSIGHT: When the going gets tough, the tough get going. The smart left a long time ago.

    Questions to Ponder:
    Are people more violently opposed to fur rather than leather because it's much easier to harass rich women than motorcycle gangs?

    iif([sarcasm]=true,iif([you have to ask]=true,"didn't work","ha ha ha"),"not sarcasm")
    copyright © 2008 sbenj69

    Sarchasm: The gulf between the author of sarcastic wit and the person who doesn't get it.

+ Reply to Thread

Similar Threads

  1. Update Syntax
    By PhloooooIsFlo in forum SQL Development
    Replies: 4
    Last Post: November 21st, 2008, 10:58 AM
  2. New Syntax Highlight BBCode
    By jmurrayhead in forum Announcements
    Replies: 0
    Last Post: October 28th, 2008, 09:44 PM
  3. syntax error? Expected ')'
    By Rebelle in forum ASP Development
    Replies: 1
    Last Post: October 21st, 2008, 04:10 PM
  4. Syntax Error with Arrays
    By BLaaaaaaaaaarche in forum ASP Development
    Replies: 4
    Last Post: August 18th, 2008, 04:14 PM
  5. syntax
    By Shem in forum .NET Development
    Replies: 1
    Last Post: July 9th, 2008, 06:11 AM

Bookmarks

Posting Permissions

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

SEO by vBSEO