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. Void where prohibited by law. Not valid in California. Your mileage may vary.
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. Void where prohibited by law. Not valid in California. Your mileage may vary.
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.
Or maybe better, just put the whole statement on one line and furgettaboutitCode:cmd.Parameters.Append cmd.CreateParameter _ ("@username",adVarChar,adParamInput,50,session("username"))
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. Void where prohibited by law. Not valid in California. Your mileage may vary.
I am annoyed, i got an error now,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 %>
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 12Code:connect = "Provider=SQLOLEDB;Persist Security Info=False;User ID=sa; &;Password=test;" ;"Initial Catalog=coursesSQL;Data Source=db location"
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:
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.
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. Void where prohibited by law. Not valid in California. Your mileage may vary.
Bookmarks