+ Reply to Thread
Page 4 of 4 FirstFirst ... 2 3 4
Results 31 to 39 of 39

Thread: Recordset and Stored Procedure issues!

  1. #31
    Barn Enthusiast Centurion is on a distinguished road Centurion's Avatar
    Join Date
    Dec 2008
    Posts
    429
    Rep Power
    2

    Quote Originally Posted by mehere View Post
    do you have an include file like adovbs.inc on your page? if so, remove your const lines.
    Error Type:
    Microsoft VBScript compilation (0x800A03EE)
    Expected ')'
    edit1.asp, line 20, column 12


    this is line 20:

    Code:
    ("@username",adVarChar,adParamInput,50,session("username"))
    

  2. #32
    Wolfmaster Wolffy is a splendid one to behold Wolffy is a splendid one to behold Wolffy is a splendid one to behold Wolffy is a splendid one to behold Wolffy is a splendid one to behold Wolffy is a splendid one to behold Wolffy is a splendid one to behold Wolffy is a splendid one to behold Wolffy's Avatar
    Join Date
    Mar 2008
    Location
    Peoria, IL
    Posts
    1,037
    Blog Entries
    2
    Rep Power
    13

    What you have there is only a fragment of a statement. Is it a continuation of the previous line? as in
    Code:
    cmd.Parameters.Append cmd.CreateParameter &_
          ("@username",adVarChar,adParamInput,50,session("username"))
    
    Wolffy
    ------------------------
    Opinions expressed are my own and do not necessity reflect those of any sane person. Any code provided is intended to be an example and is provided AS IS. Rework for your specific environment may be required. Void where prohibited by law. Not valid in California. Your mileage may vary.

  3. #33
    Barn Enthusiast Centurion is on a distinguished road Centurion's Avatar
    Join Date
    Dec 2008
    Posts
    429
    Rep Power
    2

    Quote Originally Posted by Wolffy View Post
    What you have there is only a fragment of a statement. Is it a continuation of the previous line? as in
    Code:
    cmd.Parameters.Append cmd.CreateParameter &_
          ("@username",adVarChar,adParamInput,50,session("username"))
    
    sorry not sure what you mean? are you saying i need to do the same thing for first name and surname? wouldnt this be pointless as the parameters and datatypes are defined in the stored procedure??

  4. #34
    Wolfmaster Wolffy is a splendid one to behold Wolffy is a splendid one to behold Wolffy is a splendid one to behold Wolffy is a splendid one to behold Wolffy is a splendid one to behold Wolffy is a splendid one to behold Wolffy is a splendid one to behold Wolffy is a splendid one to behold Wolffy's Avatar
    Join Date
    Mar 2008
    Location
    Peoria, IL
    Posts
    1,037
    Blog Entries
    2
    Rep Power
    13

    Uh, no. What I'm say is that the statement you posted is not a valid statement in and of itself. Unless it's part of a complete statement, as I've shown, it's going to throw an error. What the line right before the line in error?
    Wolffy
    ------------------------
    Opinions expressed are my own and do not necessity reflect those of any sane person. Any code provided is intended to be an example and is provided AS IS. Rework for your specific environment may be required. Void where prohibited by law. Not valid in California. Your mileage may vary.

  5. #35
    Barn Enthusiast Centurion is on a distinguished road Centurion's Avatar
    Join Date
    Dec 2008
    Posts
    429
    Rep Power
    2

    Quote Originally Posted by Wolffy View Post
    Uh, no. What I'm say is that the statement you posted is not a valid statement in and of itself. Unless it's part of a complete statement, as I've shown, it's going to throw an error. What the line right before the line in error?
    this is the line..

    Code:
    cmd.Parameters.Append cmd.CreateParameter &_
    

  6. #36
    Wolfmaster Wolffy is a splendid one to behold Wolffy is a splendid one to behold Wolffy is a splendid one to behold Wolffy is a splendid one to behold Wolffy is a splendid one to behold Wolffy is a splendid one to behold Wolffy is a splendid one to behold Wolffy is a splendid one to behold Wolffy's Avatar
    Join Date
    Mar 2008
    Location
    Peoria, IL
    Posts
    1,037
    Blog Entries
    2
    Rep Power
    13

    Ach, remove the ampersand. It seems it was in the example code and just kept getting missed. We most definitely do NOT was to concatenate two strings here.
    Code:
    cmd.Parameters.Append cmd.CreateParameter _
          ("@username",adVarChar,adParamInput,50,session("username"))
    
    Or maybe better, just put the whole statement on one line and furgettaboutit
    Code:
    cmd.Parameters.Append cmd.CreateParameter("@username",adVarChar,adParamInput,50,session("username"))
    
    Wolffy
    ------------------------
    Opinions expressed are my own and do not necessity reflect those of any sane person. Any code provided is intended to be an example and is provided AS IS. Rework for your specific environment may be required. Void where prohibited by law. Not valid in California. Your mileage may vary.

  7. #37
    Barn Enthusiast Centurion is on a distinguished road Centurion's Avatar
    Join Date
    Dec 2008
    Posts
    429
    Rep Power
    2

    Quote Originally Posted by Wolffy View Post
    Ach, remove the ampersand. It seems it was in the example code and just kept getting missed. We most definitely do NOT was to concatenate two strings here.
    Code:
    cmd.Parameters.Append cmd.CreateParameter _
          ("@username",adVarChar,adParamInput,50,session("username"))
    
    Or maybe better, just put the whole statement on one line and furgettaboutit
    Code:
    cmd.Parameters.Append cmd.CreateParameter("@username",adVarChar,adParamInput,50,session("username"))
    
    Code:
    <%
    Dim cmd, rs, connect, intNumber
    
    
    Set cmd = Server.CreateObject ("ADODB.Command")
    connect = "Provider=SQLOLEDB;Persist Security Info=False;User ID=sa; &;Password=test;" ;"Initial Catalog=coursesSQL;Data Source=MY DB LOCATION"
          
          
    
    cmd.ActiveConnection = connect
    cmd.CommandText = "MY STORED PROC"
    cmd.CommandType = adCmdStoredProc
    
    cmd.Parameters.Append cmd.CreateParameter("@username",adVarChar,adParamInput,50,session("username"))
    
    
    Set rs = cmd.Execute
    
    intNumber = comm.Parameters("@username")
    set cmd = nothing
    %>
    
    I am annoyed, i got an error now,

    Error Type:
    Microsoft VBScript compilation (0x800A0401)
    Expected end of statement
    edit1.asp, line 12, column 87



    once i learn how to do this propely, ill be more confident in doing my other many stored procedures and calling them from other pages..

    [edit]

    below is line 12
    Code:
    connect = "Provider=SQLOLEDB;Persist Security Info=False;User ID=sa; &;Password=test;" ;"Initial Catalog=coursesSQL;Data Source=db location"
    

  8. #38
    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
    436
    Rep Power
    7

    it looks like too many quotes ...
    Code:
    connect = "Provider=SQLOLEDB;Persist Security Info=False;User ID=sa; Password=test;Initial Catalog=coursesSQL;Data Source=db location"
    
    Quote of the Month:
    Leaders: Leaders are like eagles. We don't have either of them here.

    Questions to Ponder:
    Why do banks charge you a "non-sufficient funds fee" on money they already know you don't have?

    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.

  9. #39
    Wolfmaster Wolffy is a splendid one to behold Wolffy is a splendid one to behold Wolffy is a splendid one to behold Wolffy is a splendid one to behold Wolffy is a splendid one to behold Wolffy is a splendid one to behold Wolffy is a splendid one to behold Wolffy is a splendid one to behold Wolffy's Avatar
    Join Date
    Mar 2008
    Location
    Peoria, IL
    Posts
    1,037
    Blog Entries
    2
    Rep Power
    13

    And Data Source=db location looks a bit suspect as well. Unless that really IS the name of your database
    Wolffy
    ------------------------
    Opinions expressed are my own and do not necessity reflect those of any sane person. Any code provided is intended to be an example and is provided AS IS. Rework for your specific environment may be required. Void where prohibited by law. Not valid in California. Your mileage may vary.

+ Reply to Thread
Page 4 of 4 FirstFirst ... 2 3 4

Similar Threads

  1. SQL Job or stored procedure
    By todd2006 in forum SQL Development
    Replies: 5
    Last Post: February 11th, 2009, 02:20 PM
  2. stored procedure
    By todd2006 in forum ASP Development
    Replies: 7
    Last Post: February 5th, 2009, 03:02 PM
  3. stored procedure
    By todd2006 in forum Microsoft SQL Server
    Replies: 1
    Last Post: February 5th, 2009, 01:25 PM
  4. If statement stored procedure
    By peebman2000 in forum SQL Development
    Replies: 32
    Last Post: May 23rd, 2008, 03:54 PM
  5. Dynamic Stored Procedure
    By jmurrayhead in forum Microsoft SQL Server
    Replies: 16
    Last Post: March 26th, 2008, 11:19 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