Error 3251 trying to run stored proc after upgrade to Office 2003

G

Guest

I have an application that worked fine but which no longer works after the upgrade from Office 200 to Office 2003. The following code is involved

strUserName = Environ("USERNAME"

Set cmd = New ADODB.Comman

cmd.ActiveConnection = CurrentProject.Connectio

' The connection string...
' "Provider=Microsoft.Access.OLEDB.10.0;Persist Security Info=True;Data Source=MEGO
' User ID=rexx;Password=P@yperview;Initial Catalog=rexxDB;Data Provider=SQLOLEDB.1

cmd.CommandType = adCmdStoredPro

cmd.CommandText = "hp_IsValidUser

' The store proc heade
'SET QUOTED_IDENTIFIER OFF
'G
'SET ANSI_NULLS ON
'G
'CREATE PROCEDURE dbo.hp_IsValidUse
'
' @UserName VARCHAR(32)
' @ApplicationID INT
' @Authenticate INTEGER OUTPUT
' @ConnectionString VARCHAR(1024) OUTPU
'
'A

'SET @Authenticate =
'SET @ConnectionString = '
'...

cmd.Parameters("@UserName") = strUserNam
cmd.Parameters("@ApplicationID") = glngApplicationI

cmd.Execute options:=adExecuteNoRecord

The last command errors out with 3251 : "Object or provider is not capable of performing requested operation.

Any ideas?
 
G

Guest

Does anyone have any ideas? (reposting with a subscription nospam email address.

----- David Rogers wrote: ----

Changing the stored procedure so that it did not return a result set cleared up this particular problem. All other interactions have been eliminated as possible causes.

So, does anyone have an explanation as to why this occurs? I thought that adExecuteNoRecords was supposed to discard any result set

Thanks
Davi

----- David Rogers wrote: ----

I have an application that worked fine but which no longer works after the upgrade from Office 200 to Office 2003. The following code is involved

strUserName = Environ("USERNAME"

Set cmd = New ADODB.Comman

cmd.ActiveConnection = CurrentProject.Connectio

' The connection string...
' "Provider=Microsoft.Access.OLEDB.10.0;Persist Security Info=True;Data Source=MEGO
' User ID=rexx;Password=P@yperview;Initial Catalog=rexxDB;Data Provider=SQLOLEDB.1


cmd.CommandType = adCmdStoredPro

cmd.CommandText = "hp_IsValidUser

' The store proc heade
'SET QUOTED_IDENTIFIER OFF
'G
'SET ANSI_NULLS ON
'G
'CREATE PROCEDURE dbo.hp_IsValidUse
'
' @UserName VARCHAR(32)
' @ApplicationID INT
' @Authenticate INTEGER OUTPUT
' @ConnectionString VARCHAR(1024) OUTPU
'
'A

'SET @Authenticate =
'SET @ConnectionString = '
'...

cmd.Parameters("@UserName") = strUserNam
cmd.Parameters("@ApplicationID") = glngApplicationI

cmd.Execute options:=adExecuteNoRecord

The last command errors out with 3251 : "Object or provider is not capable of performing requested operation.

Any ideas?
 
D

Douglas J. Steele

Have you checked to see that you're getting a value for strUserName?

The Environ function is one that's affected by the Sandbox security
settings. See http://support.microsoft.com/?id=294698 for details.

In any case, I've never felt that was an appropriate way to get the user id:
it's trivial to change the value of an environment variable.
http://www.mvps.org/access/api/api0008.htm (at "The Access Web") shows a far
superior approach.

--
Doug Steele, Microsoft Access MVP

(No private e-mails, please)



David Rogers said:
Does anyone have any ideas? (reposting with a subscription nospam email address.)

----- David Rogers wrote: -----

Changing the stored procedure so that it did not return a result set
cleared up this particular problem. All other interactions have been
eliminated as possible causes.
So, does anyone have an explanation as to why this occurs? I thought
that adExecuteNoRecords was supposed to discard any result set?
Thanks,
David

----- David Rogers wrote: -----

I have an application that worked fine but which no longer works
after the upgrade from Office 200 to Office 2003. The following code is
involved:
strUserName = Environ("USERNAME")

Set cmd = New ADODB.Command

cmd.ActiveConnection = CurrentProject.Connection

' The connection string...
' "Provider=Microsoft.Access.OLEDB.10.0;Persist Security Info=True;Data Source=MEGO;
' User ID=rexx;Password=P@yperview;Initial Catalog=rexxDB;Data Provider=SQLOLEDB.1"


cmd.CommandType = adCmdStoredProc

cmd.CommandText = "hp_IsValidUser"

' The store proc header
'SET QUOTED_IDENTIFIER OFF
'GO
'SET ANSI_NULLS ON
'GO
'CREATE PROCEDURE dbo.hp_IsValidUser
'(
' @UserName VARCHAR(32),
' @ApplicationID INT,
' @Authenticate INTEGER OUTPUT,
' @ConnectionString VARCHAR(1024) OUTPUT
')
'AS
'
'SET @Authenticate = 9
'SET @ConnectionString = ''
'....

cmd.Parameters("@UserName") = strUserName
cmd.Parameters("@ApplicationID") = glngApplicationID

cmd.Execute options:=adExecuteNoRecords

The last command errors out with 3251 : "Object or provider is
not capable of performing requested operation."
 
Top