Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories

stored procedure update

I have an update stored procedure and when I call it in my vb program I get the run time error: -2147217900[Microsoft][odbc sql server driver][sql server]line 1: incorrect syntax near '12345'. where 12345 is the first textbox entry in the form I am using to update:

adoConnection.Execute "TEST_UPDATE('" & Text1.Text & "','" & Text2.Text & "','" & Text3.Text & "','" & Text4.Text & "','" & Text5.Text & "','" & Text6.Text & "')"

Something suprising is that I have another stored procedure used to update a small table, ti works but with the 19 columns table I get that message.

What am I doing wrong.

Help urgently needed.

Comments

  • Termc1224Termc1224 Member Posts: 84
    : I have an update stored procedure and when I call it in my vb program I get the run time error: -2147217900[Microsoft][odbc sql server driver][sql server]line 1: incorrect syntax near '12345'. where 12345 is the first textbox entry in the form I am using to update:
    :
    : adoConnection.Execute "TEST_UPDATE('" & Text1.Text & "','" & Text2.Text & "','" & Text3.Text & "','" & Text4.Text & "','" & Text5.Text & "','" & Text6.Text & "')"
    :
    : Something suprising is that I have another stored procedure used to update a small table, ti works but with the 19 columns table I get that message.
    :
    : What am I doing wrong.
    :
    : Help urgently needed.
    :
    : can i ask what is the value of text1 - text6?

  • PhokojoePhokojoe Member Posts: 10
    : : I have an update stored procedure and when I call it in my vb program I get the run time error: -2147217900[Microsoft][odbc sql server driver][sql server]line 1: incorrect syntax near '12345'. where 12345 is the first textbox entry in the form I am using to update:
    : :
    : : adoConnection.Execute "TEST_UPDATE('" & Text1.Text & "','" & Text2.Text & "','" & Text3.Text & "','" & Text4.Text & "','" & Text5.Text & "','" & Text6.Text & "')"
    : :
    : : Something suprising is that I have another stored procedure used to update a small table, ti works but with the 19 columns table I get that message.
    : :
    : : What am I doing wrong.
    : :
    : : Help urgently needed.
    : :
    : : can i ask what is the value of text1 - text6?
    :
    :
    Thank you for the questio!

    For the purposes of tasting, I have declared the parameters to be of char in the stored procedure. Then when I update to record say in the SQL query analyser, it wokrs fine. Actually, the method you suggested, worked it is just that now it claims that I have not supplied all the parameters.
    This is the stored procedure.
    CREATE PROCEDURE TEST_UPDATE
    (@A1 CHAR(15), @A2 CHAR(1), @A3 CHAR(2), @A4 CHAR(3), @A5 CHAR(1), @A6 CHAR(1))
    AS
    UPDATE TABLE3
    SET A1 = @A1 , A2 = @A2 , A3 = @A3 , A4 = @A4 , A5 = @A5 , A6 = @A6
    WHERE A1 = @A1
    GO

    and this is the execution of the query in vb.
    adoConnection.Execute "TEST_UPDATE'" & Text1.Text & "','" & Text2.Text & "','" & Text3.Text & "','" & Text4.Text & "','" & Text5.Text & "','" & Text6.Text & "'"

  • Termc1224Termc1224 Member Posts: 84
    : : : I have an update stored procedure and when I call it in my vb program I get the run time error: -2147217900[Microsoft][odbc sql server driver][sql server]line 1: incorrect syntax near '12345'. where 12345 is the first textbox entry in the form I am using to update:
    : : :
    : : : adoConnection.Execute "TEST_UPDATE('" & Text1.Text & "','" & Text2.Text & "','" & Text3.Text & "','" & Text4.Text & "','" & Text5.Text & "','" & Text6.Text & "')"
    : : :
    : : : Something suprising is that I have another stored procedure used to update a small table, ti works but with the 19 columns table I get that message.
    : : :
    : : : What am I doing wrong.
    : : :
    : : : Help urgently needed.
    : : :
    : : : can i ask what is the value of text1 - text6?
    : :
    : :
    : Thank you for the questio!
    :
    : For the purposes of tasting, I have declared the parameters to be of char in the stored procedure. Then when I update to record say in the SQL query analyser, it wokrs fine. Actually, the method you suggested, worked it is just that now it claims that I have not supplied all the parameters.
    : This is the stored procedure.
    : CREATE PROCEDURE TEST_UPDATE
    : (@A1 CHAR(15), @A2 CHAR(1), @A3 CHAR(2), @A4 CHAR(3), @A5 CHAR(1), @A6 CHAR(1))
    : AS
    : UPDATE TABLE3
    : SET A1 = @A1 , A2 = @A2 , A3 = @A3 , A4 = @A4 , A5 = @A5 , A6 = @A6
    : WHERE A1 = @A1
    : GO
    :
    : and this is the execution of the query in vb.
    : adoConnection.Execute "TEST_UPDATE'" & Text1.Text & "','" & Text2.Text & "','" & Text3.Text & "','" & Text4.Text & "','" & Text5.Text & "','" & Text6.Text & "'"
    :
    : if you your adoconnection as define as adodb.connection then this is the complete syntax with the extra parameter
    adoConnection.execute (Commandtext as String), [recordsaffected]
    adoConnection.Execute "TEST_UPDATE", Text1.Text & "','" & Text2.Text & "','" & Text3.Text & "','" & Text4.Text & "','" & Text5.Text & "','" & Text6.Text & "'"

  • PhokojoePhokojoe Member Posts: 10
    : : : : I have an update stored procedure and when I call it in my vb program I get the run time error: -2147217900[Microsoft][odbc sql server driver][sql server]line 1: incorrect syntax near '12345'. where 12345 is the first textbox entry in the form I am using to update:
    : : : :
    : : : : adoConnection.Execute "TEST_UPDATE('" & Text1.Text & "','" & Text2.Text & "','" & Text3.Text & "','" & Text4.Text & "','" & Text5.Text & "','" & Text6.Text & "')"
    : : : :
    : : : : Something suprising is that I have another stored procedure used to update a small table, ti works but with the 19 columns table I get that message.
    : : : :
    : : : : What am I doing wrong.
    : : : :
    : : : : Help urgently needed.
    : : : :
    : : : : can i ask what is the value of text1 - text6?
    : : :
    : : :
    : : Thank you for the questio!
    : :
    : : For the purposes of tasting, I have declared the parameters to be of char in the stored procedure. Then when I update to record say in the SQL query analyser, it wokrs fine. Actually, the method you suggested, worked it is just that now it claims that I have not supplied all the parameters.
    : : This is the stored procedure.
    : : CREATE PROCEDURE TEST_UPDATE
    : : (@A1 CHAR(15), @A2 CHAR(1), @A3 CHAR(2), @A4 CHAR(3), @A5 CHAR(1), @A6 CHAR(1))
    : : AS
    : : UPDATE TABLE3
    : : SET A1 = @A1 , A2 = @A2 , A3 = @A3 , A4 = @A4 , A5 = @A5 , A6 = @A6
    : : WHERE A1 = @A1
    : : GO
    : :
    : : and this is the execution of the query in vb.
    : : adoConnection.Execute "TEST_UPDATE'" & Text1.Text & "','" & Text2.Text & "','" & Text3.Text & "','" & Text4.Text & "','" & Text5.Text & "','" & Text6.Text & "'"
    : :
    : : if you your adoconnection as define as adodb.connection then this is the complete syntax with the extra parameter
    : adoConnection.execute (Commandtext as String), [recordsaffected]
    : adoConnection.Execute "TEST_UPDATE", Text1.Text & "','" & Text2.Text & "','" & Text3.Text & "','" & Text4.Text & "','" & Text5.Text & "','" & Text6.Text & "'"
    :
    :
    Thank you for the response
    I have tried the suggestion you made but I still get the message that the parameter @A1 which is expected is not supplied. I tried everything but the stored procedure cannot work!

    Any suggestion!

  • Termc1224Termc1224 Member Posts: 84
    [b][red]This message was edited by Termc1224 at 2006-5-28 20:26:25[/red][/b][hr]
    : : : : : I have an update stored procedure and when I call it in my vb program I get the run time error: -2147217900[Microsoft][odbc sql server driver][sql server]line 1: incorrect syntax near '12345'. where 12345 is the first textbox entry in the form I am using to update:
    : : : : :
    : : : : : adoConnection.Execute "TEST_UPDATE('" & Text1.Text & "','" & Text2.Text & "','" & Text3.Text & "','" & Text4.Text & "','" & Text5.Text & "','" & Text6.Text & "')"
    : : : : :
    : : : : : Something suprising is that I have another stored procedure used to update a small table, ti works but with the 19 columns table I get that message.
    : : : : :
    : : : : : What am I doing wrong.
    : : : : :
    : : : : : Help urgently needed.
    : : : : :
    : : : : : can i ask what is the value of text1 - text6?
    : : : :
    : : : :
    : : : Thank you for the questio!
    : : :
    : : : For the purposes of tasting, I have declared the parameters to be of char in the stored procedure. Then when I update to record say in the SQL query analyser, it wokrs fine. Actually, the method you suggested, worked it is just that now it claims that I have not supplied all the parameters.
    : : : This is the stored procedure.
    : : : CREATE PROCEDURE TEST_UPDATE
    : : : (@A1 CHAR(15), @A2 CHAR(1), @A3 CHAR(2), @A4 CHAR(3), @A5 CHAR(1), @A6 CHAR(1))
    : : : AS
    : : : UPDATE TABLE3
    : : : SET A1 = @A1 , A2 = @A2 , A3 = @A3 , A4 = @A4 , A5 = @A5 , A6 = @A6
    : : : WHERE A1 = @A1
    : : : GO
    : : :
    : : : and this is the execution of the query in vb.
    : : : adoConnection.Execute "TEST_UPDATE'" & Text1.Text & "','" & Text2.Text & "','" & Text3.Text & "','" & Text4.Text & "','" & Text5.Text & "','" & Text6.Text & "'"
    : : :
    : : : if you your adoconnection as define as adodb.connection then this is the complete syntax with the extra parameter
    : : adoConnection.execute (Commandtext as String), [recordsaffected]
    : : adoConnection.Execute "TEST_UPDATE", Text1.Text & "','" & Text2.Text & "','" & Text3.Text & "','" & Text4.Text & "','" & Text5.Text & "','" & Text6.Text & "'"
    : :
    : :
    : Thank you for the response
    : I have tried the suggestion you made but I still get the message that the parameter @A1 which is expected is not supplied. I tried everything but the stored procedure cannot work!
    :
    : Any suggestion!
    :
    : Hope this work, cause i've never use execute before.
    adoConnection.Execute "TEST_UPDATE '" & Text1.Text & "','" & Text2.Text & "','" & Text3.Text & "','" & Text4.Text & "','" & Text5.Text & "','" & Text6.Text & "'", "A1,a2,a3,a4,a5,a6"



Sign In or Register to comment.