DeveloperBarn Forums

DeveloperBarn

Programming & IT forum

Recordset and Stored Procedure issues!

This is a discussion on Recordset and Stored Procedure issues! within the ASP Development forums, part of the Programming & Scripting category; Originally Posted by mehere do you have an include file like adovbs.inc on your page? if so, remove your const ...

Go Back   DeveloperBarn Forums > Programming & Scripting > ASP Development

  #31  
Old June 23rd, 2009, 12:17 PM
Centurion's Avatar
Barn Enthusiast
 
Join Date: Dec 2008
Posts: 352
Rep Power: 2
Centurion is on a distinguished road
Default

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"))
Reply With Quote
  #32  
Old June 23rd, 2009, 03:26 PM
Wolffy's Avatar
Wolfmaster
 
Join Date: Mar 2008
Real name: Wolff
Location: Peoria, IL
Posts: 779
Blog Entries: 1
Rep Power: 9
Wolffy is a splendid one to beholdWolffy is a splendid one to beholdWolffy is a splendid one to beholdWolffy is a splendid one to beholdWolffy is a splendid one to beholdWolffy is a splendid one to beholdWolffy is a splendid one to behold
Default

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.
Reply With Quote
  #33  
Old June 24th, 2009, 04:59 AM
Centurion's Avatar
Barn Enthusiast
 
Join Date: Dec 2008
Posts: 352
Rep Power: 2
Centurion is on a distinguished road
Default

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??
Reply With Quote
  #34  
Old June 24th, 2009, 09:45 AM
Wolffy's Avatar
Wolfmaster
 
Join Date: Mar 2008
Real name: Wolff
Location: Peoria, IL
Posts: 779
Blog Entries: 1
Rep Power: 9
Wolffy is a splendid one to beholdWolffy is a splendid one to beholdWolffy is a splendid one to beholdWolffy is a splendid one to beholdWolffy is a splendid one to beholdWolffy is a splendid one to beholdWolffy is a splendid one to behold
Default

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?
Reply With Quote
  #35  
Old June 24th, 2009, 11:29 AM
Centurion's Avatar
Barn Enthusiast
 
Join Date: Dec 2008
Posts: 352
Rep Power: 2
Centurion is on a distinguished road
Default

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 &_
Reply With Quote
  #36  
Old June 24th, 2009, 11:40 AM
Wolffy's Avatar
Wolfmaster
 
Join Date: Mar 2008
Real name: Wolff
Location: Peoria, IL
Posts: 779
Blog Entries: 1
Rep Power: 9
Wolffy is a splendid one to beholdWolffy is a splendid one to beholdWolffy is a splendid one to beholdWolffy is a splendid one to beholdWolffy is a splendid one to beholdWolffy is a splendid one to beholdWolffy is a splendid one to behold
Default

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"))
Reply With Quote
  #37  
Old June 25th, 2009, 05:01 AM
Centurion's Avatar
Barn Enthusiast
 
Join Date: Dec 2008
Posts: 352
Rep Power: 2
Centurion is on a distinguished road
Default

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"
Reply With Quote
  #38  
Old June 25th, 2009, 08:08 AM
mehere's Avatar
Super Sarcasm Mistress
 
Join Date: Mar 2008
Real name: Joanne
Location: Wide Awake In Dreamland
Posts: 375
Rep Power: 6
mehere is just really nicemehere is just really nicemehere is just really nicemehere is just really nicemehere is just really nice
Default

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:
Mistakes: It could be that the purpose of your life is only to serve as a warning to others.

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.
Reply With Quote
  #39  
Old June 25th, 2009, 09:42 AM
Wolffy's Avatar
Wolfmaster
 
Join Date: Mar 2008
Real name: Wolff
Location: Peoria, IL
Posts: 779
Blog Entries: 1
Rep Power: 9
Wolffy is a splendid one to beholdWolffy is a splendid one to beholdWolffy is a splendid one to beholdWolffy is a splendid one to beholdWolffy is a splendid one to beholdWolffy is a splendid one to beholdWolffy is a splendid one to behold
Default

And Data Source=db location looks a bit suspect as well. Unless that really IS the name of your database
Reply With Quote
Reply

  DeveloperBarn Forums > Programming & Scripting > ASP Development

Bookmarks

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads

Thread Thread Starter Forum Replies Last Post
SQL Job or stored procedure todd2006 SQL Development 5 February 11th, 2009 02:20 PM
stored procedure todd2006 ASP Development 7 February 5th, 2009 03:02 PM
stored procedure todd2006 Microsoft SQL Server 1 February 5th, 2009 01:25 PM
If statement stored procedure peebman2000 SQL Development 32 May 23rd, 2008 03:54 PM
Dynamic Stored Procedure jmurrayhead Microsoft SQL Server 16 March 26th, 2008 11:19 AM


All times are GMT -4. The time now is 10:21 PM.


Copyright ©2008-2010, DeveloperBarn

Content Relevant URLs by vBSEO 3.3.2