Sybase NNTP forums - End Of Life (EOL)

The NNTP forums from Sybase - forums.sybase.com - are now closed.

All new questions should be directed to the appropriate forum at the SAP Community Network (SCN).

Individual products have links to the respective forums on SCN, or you can go to SCN and search for your product in the search box (upper right corner) to find your specific developer center.

Error with ADO.Command Object

4 posts in General Discussion Last posting was on 2003-05-02 21:22:29.0Z
Richard Posted on 2003-05-02 14:22:41.0Z
From: "Richard" <Richardr@ldsinc.com>
Subject: Error with ADO.Command Object
Date: Fri, 2 May 2003 09:22:41 -0500
Lines: 25
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2800.1158
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165
Message-ID: <#iiQXcLEDHA.81@forums-2-dub>
Newsgroups: ianywhere.public.general
NNTP-Posting-Host: lds253.ldsinc.com 66.6.104.253
Path: forums-1-dub!forums-master.sybase.com!forums-2-dub.sybase.com
Xref: forums-1-dub ianywhere.public.general:976
Article PK: 3335

I am having problems with Executing a Stored Procedure using the Command
Object in ADO. Here is my code can anyone see were my mistake may be?


Dim iRc As Integer
Dim cmd As ADODB.Command
Set cmd = New Command

With ADOConnect1
Set cmd.ActiveConnection = .Connection
cmd.CommandType = adCmdText ' same error with adCmdStoredProc
cmd.CommandText = "{" & iReturnCode & " = Call
DBA.sp_Adm_ValidateLogon( '" & .UserID & "')} "
cmd.Execute <<<Error on this statement
End With


Error
Description: [Sybase][ODBC Driver]Syntax error or access violation
Number: -2147217911
ConnectionString
Provider=MSDASQL;DBF=C:\Richard\Data\Test8.db;;DRIVER={Adaptive Server
Anywhere 8.0};INTEGRATED=NO;User ID=lds;Password=lds;


Richard Posted on 2003-05-02 15:44:33.0Z
From: Richard
Date: Fri, 2 May 2003 11:44:33 -0400
Newsgroups: ianywhere.public.general
Subject: Re: Error with ADO.Command Object
Message-ID: <D9DB4B4046D507B1005679FA85256D1A.0054745385256D1A@webforums>
References: <#iiQXcLEDHA.81@forums-2-dub>
Lines: 14
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Path: forums-1-dub!forums-master.sybase.com!webforums.sybase.com!news
Xref: forums-1-dub ianywhere.public.general:977
Article PK: 2965

Dim iRc As Integer
Dim cmd As ADODB.Command
Set cmd = New Command
With ADOConnect1
Set cmd.ActiveConnection = .Connection
cmd.CommandType = adCmdText ' same error with adCmdStoredProc
cmd.CommandText = "{" & iRC & " = Call
DBA.sp_Adm_ValidateLogon( '" & .UserID & "')} "
cmd.Execute <<<Error on this statement
End With

NOTE: This is only a update to the code...Still having errors on it I ONLY
corrected naming variable iRC and Still doesn't work


Chris Keating (iAnywhere Solutions) Posted on 2003-05-02 19:42:05.0Z
From: "Chris Keating \(iAnywhere Solutions\)" <keating@iAnywhere.com>
References: <#iiQXcLEDHA.81@forums-2-dub>
Subject: Re: Error with ADO.Command Object
Date: Fri, 2 May 2003 15:42:05 -0400
Lines: 43
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2800.1106
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1106
Message-ID: <uF5Z2OOEDHA.314@forums-2-dub>
Newsgroups: ianywhere.public.general
NNTP-Posting-Host: keating-xp.sybase.com 172.31.140.19
Path: forums-1-dub!forums-master.sybase.com!forums-2-dub.sybase.com
Xref: forums-1-dub ianywhere.public.general:981
Article PK: 3338

Have you tried without the encapsulating curly braces { ... }?

--

Chris Keating
Sybase Adaptive Server Anywhere Professional Version 8
iAnywhere Solutions http://www.iAnywhere.com

** Please only post to the newsgroup

** Whitepapers can be found at http://www.iAnywhere.com/developer
** EBFs can be found at http://downloads.sybase.com/swx/sdmain.stm
** Use CaseXpress to report bugs http://casexpress.sybase.com

"Richard" <Richardr@ldsinc.com> wrote in message
news:#iiQXcLEDHA.81@forums-2-dub...
> I am having problems with Executing a Stored Procedure using the Command
> Object in ADO. Here is my code can anyone see were my mistake may be?
>
>
> Dim iRc As Integer
> Dim cmd As ADODB.Command
> Set cmd = New Command
>
> With ADOConnect1
> Set cmd.ActiveConnection = .Connection
> cmd.CommandType = adCmdText ' same error with adCmdStoredProc
> cmd.CommandText = "{" & iReturnCode & " = Call
> DBA.sp_Adm_ValidateLogon( '" & .UserID & "')} "
> cmd.Execute <<<Error on this statement
> End With
>
>
> Error
> Description: [Sybase][ODBC Driver]Syntax error or access violation
> Number: -2147217911
> ConnectionString
> Provider=MSDASQL;DBF=C:\Richard\Data\Test8.db;;DRIVER={Adaptive Server
> Anywhere 8.0};INTEGRATED=NO;User ID=lds;Password=lds;
>
>


Richard Posted on 2003-05-02 21:22:29.0Z
From: Richard
Date: Fri, 2 May 2003 17:22:29 -0400
Newsgroups: ianywhere.public.general
Subject: Re: Error with ADO.Command Object
Message-ID: <6BF91BB7295D4EC200756A5D85256D1A.00721E1F85256D1A@webforums>
References: <#iiQXcLEDHA.81@forums-2-dub> <uF5Z2OOEDHA.314@forums-2-dub>
Lines: 6
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Path: forums-1-dub!forums-master.sybase.com!webforums.sybase.com!news
Xref: forums-1-dub ianywhere.public.general:982
Article PK: 3339

It needs the { } in order to call Stored Procedures...It works throught the
Recordset Object but not through the Command Object...the Stored Proc in
this instance isn't returning any records...Only return value.

Thanks
Richard