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.

ADO Provider Error

3 posts in General Discussion Last posting was on 2003-04-24 19:31:48.0Z
Richard Posted on 2003-04-24 19:23:50.0Z
From: Richard
Date: Thu, 24 Apr 2003 15:23:50 -0400
Newsgroups: ianywhere.public.general
Subject: ADO Provider Error
Message-ID: <6A45ABCA1CB8E151006A8D8085256D12.006A8D9085256D12@webforums>
Lines: 36
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:940
Article PK: 2948

Hello,

I am trying to return multiple recordset from a stored Procedure through
ADO and I am getting an error the tell me the it is not supported by the
provider.

Here is my code maybe there is another way I can achieve the result with
another supported provider for SQLAnywhere

Thanks


goConn.Provider = "ASAProv.80" ' or ASAProv.70
goConn.ConnectionString =
"DBF=C:\Richard\Data\Test8.db;;INTEGRATED=NO;User ID=lds;Password=lds;"
goConn.Open

rs.CursorLocation = adUseClient 'rs.CursorLocation = adUseServer

' Set the SQL string
' Prepare Stored Proc execution
SQL = "{Call DBA.sp_ADM_GetUsers( )} "
rs.CursorLocation = adUseClient 'rs.CursorLocation = adUseServer
rs.Open SQL, goConn, adOpenStatic, adLockReadOnly, adCmdText

Do Until rs Is Nothing
If Not rs.EOF And Not rs.BOF Then
Do Until rs.EOF
Debug.Print "UserName: "; rs.Fields("UserName").Value
rs.MoveNext
Loop
End If
Set rs = rs.NextRecordset

Loop


Jason Hinsperger Posted on 2003-04-24 19:27:10.0Z
From: "Jason Hinsperger" <NOJason_HinspergerSPAM@hotmail.com>
References: <6A45ABCA1CB8E151006A8D8085256D12.006A8D9085256D12@webforums>
Subject: Re: ADO Provider Error
Date: Thu, 24 Apr 2003 15:27:10 -0400
Lines: 65
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: <efX6pfpCDHA.331@forums-1-dub>
Newsgroups: ianywhere.public.general
NNTP-Posting-Host: hinsperg-pc1.sybase.com 172.31.143.226
Path: forums-1-dub!forums-master.sybase.com!forums-1-dub.sybase.com
Xref: forums-1-dub ianywhere.public.general:941
Article PK: 2947

You have to set the "ASA Multiple Results" property before connecting. Here
is an example:

'Set ASA Multiple Results to true
objConn.Provider = "ASAProv"
objConn.Properties("ASA Multiple Results") = True
'Open database connection, adUseServer is default
'objConn.CursorLocation = adUseServer
objConn.ConnectionString = ConnectText
objConn.Open

Also, this is supported for server side cursors only. You cannot use client
side cursors and retrieve multiple result sets.

--
Jason Hinsperger
International and Sustaining Engineering
iAnywhere Solutions

Whitepapers, TechDocs, and bug fixes are all available through the iAnywhere
Developer Community at www.ianywhere.com/developer
--

<Richard> wrote in message
news:6A45ABCA1CB8E151006A8D8085256D12.006A8D9085256D12@webforums...
> Hello,
>
> I am trying to return multiple recordset from a stored Procedure through
> ADO and I am getting an error the tell me the it is not supported by the
> provider.
>
> Here is my code maybe there is another way I can achieve the result with
> another supported provider for SQLAnywhere
>
> Thanks
>
>
> goConn.Provider = "ASAProv.80" ' or ASAProv.70
> goConn.ConnectionString =
> "DBF=C:\Richard\Data\Test8.db;;INTEGRATED=NO;User ID=lds;Password=lds;"
> goConn.Open
>
> rs.CursorLocation = adUseClient 'rs.CursorLocation = adUseServer
>
> ' Set the SQL string
> ' Prepare Stored Proc execution
> SQL = "{Call DBA.sp_ADM_GetUsers( )} "
> rs.CursorLocation = adUseClient 'rs.CursorLocation = adUseServer
> rs.Open SQL, goConn, adOpenStatic, adLockReadOnly, adCmdText
>
> Do Until rs Is Nothing
> If Not rs.EOF And Not rs.BOF Then
> Do Until rs.EOF
> Debug.Print "UserName: "; rs.Fields("UserName").Value
> rs.MoveNext
> Loop
> End If
> Set rs = rs.NextRecordset
>
> Loop
>
>


Michael Gould Posted on 2003-04-24 19:31:48.0Z
From: "Michael Gould" <mgould@omnicc.com>
References: <6A45ABCA1CB8E151006A8D8085256D12.006A8D9085256D12@webforums>
Subject: Re: ADO Provider Error
Date: Thu, 24 Apr 2003 15:31:48 -0400
Lines: 50
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: <OFVEmjpCDHA.283@forums-2-dub>
Newsgroups: ianywhere.public.general
NNTP-Posting-Host: adsl-17-253-234.jax.bellsouth.net 68.17.253.234
Path: forums-1-dub!forums-master.sybase.com!forums-2-dub.sybase.com
Xref: forums-1-dub ianywhere.public.general:942
Article PK: 3319

Richard,

Try the MSProvider for ODBC and see if it works there. If I have a problem
with the ASA provider, I normally switch to the MS Provider for ODBC and see
if it works there. If it doesn't then it probably isn't a problem with the
ASA provider.

Michael Gould

<Richard> wrote in message
news:6A45ABCA1CB8E151006A8D8085256D12.006A8D9085256D12@webforums...
> Hello,
>
> I am trying to return multiple recordset from a stored Procedure through
> ADO and I am getting an error the tell me the it is not supported by the
> provider.
>
> Here is my code maybe there is another way I can achieve the result with
> another supported provider for SQLAnywhere
>
> Thanks
>
>
> goConn.Provider = "ASAProv.80" ' or ASAProv.70
> goConn.ConnectionString =
> "DBF=C:\Richard\Data\Test8.db;;INTEGRATED=NO;User ID=lds;Password=lds;"
> goConn.Open
>
> rs.CursorLocation = adUseClient 'rs.CursorLocation = adUseServer
>
> ' Set the SQL string
> ' Prepare Stored Proc execution
> SQL = "{Call DBA.sp_ADM_GetUsers( )} "
> rs.CursorLocation = adUseClient 'rs.CursorLocation = adUseServer
> rs.Open SQL, goConn, adOpenStatic, adLockReadOnly, adCmdText
>
> Do Until rs Is Nothing
> If Not rs.EOF And Not rs.BOF Then
> Do Until rs.EOF
> Debug.Print "UserName: "; rs.Fields("UserName").Value
> rs.MoveNext
> Loop
> End If
> Set rs = rs.NextRecordset
>
> Loop
>
>