Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
| Author |
Topic |
|
davidliv
Starting Member
45 Posts |
Posted - 2004-02-03 : 21:25:36
|
| This should be simple. I have two other scripts using the same code (different stored proc) and they work fine. I'm getting the useful error message below.===========================error message:===========================Microsoft OLE DB Provider for ODBC Drivers (0x80040E21)Multiple-step OLE DB operation generated errors. Check each OLE DB status value, if available. No work was done./adotest.asp, line 35===========================Here is the asp code:===========================Dim erID, sRole, sName, sExternal, sFunction, sParticipationerID = 1280sRole = "not selected"sName = "John Doe"sExternal = "0"sFunction = "not selected"sParticipation = "100"Set cmd = Server.CreateObject("ADODB.Command")Conn.OpenWith cmd .ActiveConnection = conn .CommandText = "adm_ERPrjGovernance_Add" .CommandType = adCmdStoredProc .Parameters.Append .CreateParameter("@iID", adInteger,adParamInput,, erID) .Parameters.Append .CreateParameter("@Role", adVarChar, adParamInput, 25,sRole) .Parameters.Append .CreateParameter("@Name", adVarChar, adParamInput, 100,sName) .Parameters.Append .CreateParameter("@IsExt", adBoolean, adParamInput, 1,sExternal) .Parameters.Append .CreateParameter("@Function", adVarChar, adParamInput,50,sFunction) .Parameters.Append .CreateParameter("@Participation", adDecimal, adParamInput, ,sParticipation) .Execute End WithConn.Closeset conn = nothingset cmd = nothing===========================Here is the stored proc:===========================CREATE PROCEDURE adm_MyTable_Add(@iID int,@Role varchar(25),@Name varchar(100),@IsExt bit,@Function varchar(50),@Participation decimal) ASDeclare @iDescID intSELECT @iDescID = desc_id FROM tbl_desc WHERE my_id = @iIDDeclare @RoleID intSELECT @RoleID = role_id FROM tbl_roles WHERE role_name = @Roleif @@rowcount = 0begin SELECT @RoleID = 1endDeclare @FunctionID intSELECT @FunctionID = function_id FROM tbl_functions WHERE function_name = @Functionif @@rowcount = 0begin SELECT @FunctionID = 1endINSERT INTO tbl_MyTable(desc_id, myid, role_id, resource, iexternal, function_id, participation)VALUES (@iDescID, @iID, @RoleID, @Name, @IsExt, @FunctionID, @Participation)GO===========================The stored proc works fine using Query AnalyzerThanks in advance-david |
|
|
Merkin
Funky Drop Bear Fearing SQL Dude!
4970 Posts |
Posted - 2004-02-03 : 21:35:47
|
| HiTry wrapping the commands inside your proc in SET NOCOUNT ON and SET NOCOUNT OFF.I.E.Create Proc FooASSET NOCOUNT ON--do stuffSET NOCOUNT OFFGOWithout that, each of your commands returns a "n Rows Affected" message to ADO which it considers to be a separate result set.Damian |
 |
|
|
davidliv
Starting Member
45 Posts |
Posted - 2004-02-03 : 21:38:49
|
| Same problem. |
 |
|
|
Merkin
Funky Drop Bear Fearing SQL Dude!
4970 Posts |
Posted - 2004-02-03 : 21:51:09
|
| Ahhh okThen I think your problem is probably passing a string "0" to a boolean parameter. "0" is a character, not a boolean value. Try passing true or false.Damian |
 |
|
|
davidliv
Starting Member
45 Posts |
Posted - 2004-02-03 : 22:28:39
|
| Nope. I fixed it though. Problem delt w/ the adDecimal field.I added the following to my asp code (just before the ".Execute")and all is well.Parameters("@Participation").Precision=18 .Parameters("@Participation").NumericScale = 2Thanks for you help though.-david |
 |
|
|
|
|
|
|
|