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.

ASA 8 and 9 - DIAG [01S02] [Sybase][ODBC Driver][Adaptive Server Anywhere]Cursor option values changed (121)

4 posts in General Discussion Last posting was on 2004-08-25 13:34:15.0Z
Georg Jung Posted on 2004-08-20 10:02:53.0Z
From: "Georg Jung" <georg.jung@atosorigin.com>
Newsgroups: ianywhere.public.general
Subject: ASA 8 and 9 - DIAG [01S02] [Sybase][ODBC Driver][Adaptive Server Anywhere]Cursor option values changed (121)
Lines: 73
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2800.1437
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1441
NNTP-Posting-Host: whitechalk.cgtec.sema.de
X-Original-NNTP-Posting-Host: whitechalk.cgtec.sema.de
Message-ID: <4125cc4d$1@forums-1-dub>
Date: 20 Aug 2004 03:02:53 -0700
X-Trace: forums-1-dub 1092996173 192.76.140.113 (20 Aug 2004 03:02:53 -0700)
X-Original-Trace: 20 Aug 2004 03:02:53 -0700, whitechalk.cgtec.sema.de
X-Authenticated-User: pbtenbeta
Path: forums-1-dub!not-for-mail
Xref: forums-1-dub ianywhere.public.general:3411
Article PK: 7321

Dear all,

i have a problem with SQL Anywhere 8 and 9 (even 9.0.1.1899) using ADO code
in VB like below.
The reason is the combination of distinct in the Select and the cursor
option for the record set.

If i took "adOpenForwardOnly" as a cursor option - all is fine

In SQL Anywhere 6 or 7 the code below was no problem.

The alternative using ASAProv as a provider (uncomment the row)
'myConn.Provider = "ASAProv"
or
myConn.ConnectionString = _
"DSN=mydb;UID=dba;PWD=sql;Provider=ASAProv"
is a other solution - (OLEDB)
but why is this combination a problem only in the newer releases ?

Hope for an answer - see example code below...

Best regards
Georg

Private Sub cmdQuery_Click()
' Declare variables
Dim myConn As New ADODB.Connection
Dim myCommand As New ADODB.Command
Dim myRS As New ADODB.Recordset

On Error GoTo ErrorHandler:

' Establish the connection
'myConn.Provider = "ASAProv"
myConn.ConnectionString = _
"DSN=mydb;UID=dba;PWD=sql"
myConn.CursorLocation = adUseServer
myConn.Mode = adModeReadWrite
myConn.IsolationLevel = adXactCursorStability
myConn.Open

'Execute a query
Set myRS = New Recordset
myRS.CacheSize = 50
myRS.Source = "Select distinct col_no from table_col"
myRS.ActiveConnection = myConn
myRS.CursorType = adOpenKeyset
myRS.LockType = adLockOptimistic
myRS.Open
If myConn.Errors.Count > 0 Then
MsgBox CStr(myConn.Errors.Item(0)), vbInformation, ""
myRS.Close
myConn.Close
Exit Sub
End If
'Scroll through the results
myRS.MoveFirst
Do While Not myRS.EOF
MsgBox myRS.Fields("col_no"), vbInformation
myRS.MoveNext
Loop

myRS.Close
myConn.Close
Exit Sub
ErrorHandler:
MsgBox Error(Err)
Exit Sub
End Sub


Robert Waywell Posted on 2004-08-23 17:37:35.0Z
From: "Robert Waywell" <nospam_rwaywell@ianywhere.com>
Newsgroups: ianywhere.public.general
References: <4125cc4d$1@forums-1-dub>
Subject: Re: ASA 8 and 9 - DIAG [01S02] [Sybase][ODBC Driver][Adaptive Server Anywhere]Cursor option values changed (121)
Lines: 154
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2600.0000
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2600.0000
X-Original-NNTP-Posting-Host: rwaywell-pc.sybase.com
Message-ID: <412a2cc5$4@forums-2-dub>
X-Original-Trace: 23 Aug 2004 10:43:33 -0700, rwaywell-pc.sybase.com
X-Original-NNTP-Posting-Host: forums-2-dub.sybase.com
X-Original-Trace: 23 Aug 2004 10:27:40 -0700, forums-2-dub.sybase.com
NNTP-Posting-Host: forums-master.sybase.com
X-Original-NNTP-Posting-Host: forums-master.sybase.com
Date: 23 Aug 2004 10:37:35 -0700
X-Trace: forums-1-dub 1093282655 10.22.108.75 (23 Aug 2004 10:37:35 -0700)
X-Original-Trace: 23 Aug 2004 10:37:35 -0700, forums-master.sybase.com
X-Authenticated-User: ngsysop
Path: forums-1-dub!not-for-mail
Xref: forums-1-dub ianywhere.public.general:3415
Article PK: 7317

First point is that the SQLCode 121 indicates a warning (+ SQLCode value)
rather than an error (- SQLCode value).

The documentation explains this SQLCODE as:

ASA Error Messages

Database Error Messages

Alphabetic list of error messages

Cursor option values changed
...
Probable cause
The engine could not support the requested cursor option values for the
associated query, and similar option settings were substituted.
There were a number of changes made to cursor behaviour between the 7.x
codeline and the 8.x codeline in order to improve cursor semantics to more
closely match both the ANSI standards and other vendors. Reference to these
changes is made in the following section of the docs:

What's New in SQL Anywhere Studio

What's New in Version 8.0.0

Behavior changes in version 8

Adaptive Server Anywhere behavior changes
...
Cursor changes A side effect of cursor enhancements is that the cursors
in this version provide behavior closer to defined standards than before.
This may produce cursor sensitivity changes for some cursors, as Adaptive
Server Anywhere supplies behavior that better matches the expectations of
ODBC and other interfaces. For example, embedded SQL SCROLL cursors now
disallow prefetching, so that value changes are reflected in the cursor.

This change may affect existing applications that check return codes only
for SQL_SUCCESS and not SQL_SUCCESS_WITH_INFO. Applications that check for
SQL_SUCCESS_WITH_INFO receive a warning if the cursor behavior is different
from that requested. The warning is SQLCODE=121, SQLSTATE 01S02.

Insensitive cursors are not updatable.

For more information, see Insensitive cursors.

I am a bit confused by this line:

> The alternative using ASAProv as a provider (uncomment the row)


What provider are you currently using?


--
-----------------------------------------------
Robert Waywell
Sybase Adaptive Server Anywhere Developer - Version 8
Sybase Certified Professional

Sybase's iAnywhere Solutions

Please respond ONLY to newsgroup

EBF's and Patches: http://downloads.sybase.com
choose SQL Anywhere Studio >> change 'time frame' to all

To Submit Bug Reports:
http://case-express.sybase.com/cx/cx.stm?starturl=casemessage.ssc?CASETYPE=B
ug

SQL Anywhere Studio Supported Platforms and Support Status
http://my.sybase.com/detail?id=1002288

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

"Georg Jung" <georg.jung@atosorigin.com> wrote in message
news:4125cc4d$1@forums-1-dub...
> Dear all,
>
> i have a problem with SQL Anywhere 8 and 9 (even 9.0.1.1899) using ADO
code
> in VB like below.
> The reason is the combination of distinct in the Select and the cursor
> option for the record set.
>
> If i took "adOpenForwardOnly" as a cursor option - all is fine
>
> In SQL Anywhere 6 or 7 the code below was no problem.
>
> The alternative using ASAProv as a provider (uncomment the row)
> 'myConn.Provider = "ASAProv"
> or
> myConn.ConnectionString = _
> "DSN=mydb;UID=dba;PWD=sql;Provider=ASAProv"
> is a other solution - (OLEDB)
> but why is this combination a problem only in the newer releases ?
>
> Hope for an answer - see example code below...
>
> Best regards
> Georg
>
> Private Sub cmdQuery_Click()
> ' Declare variables
> Dim myConn As New ADODB.Connection
> Dim myCommand As New ADODB.Command
> Dim myRS As New ADODB.Recordset
>
> On Error GoTo ErrorHandler:
>
> ' Establish the connection
> 'myConn.Provider = "ASAProv"
> myConn.ConnectionString = _
> "DSN=mydb;UID=dba;PWD=sql"
> myConn.CursorLocation = adUseServer
> myConn.Mode = adModeReadWrite
> myConn.IsolationLevel = adXactCursorStability
> myConn.Open
>
> 'Execute a query
> Set myRS = New Recordset
> myRS.CacheSize = 50
> myRS.Source = "Select distinct col_no from table_col"
> myRS.ActiveConnection = myConn
> myRS.CursorType = adOpenKeyset
> myRS.LockType = adLockOptimistic
> myRS.Open
> If myConn.Errors.Count > 0 Then
> MsgBox CStr(myConn.Errors.Item(0)), vbInformation, ""
> myRS.Close
> myConn.Close
> Exit Sub
> End If
> 'Scroll through the results
> myRS.MoveFirst
> Do While Not myRS.EOF
> MsgBox myRS.Fields("col_no"), vbInformation
> myRS.MoveNext
> Loop
>
> myRS.Close
> myConn.Close
> Exit Sub
> ErrorHandler:
> MsgBox Error(Err)
> Exit Sub
> End Sub
>
>
>
>


Georg Jung Posted on 2004-08-25 12:16:55.0Z
From: "Georg Jung" <georg.jung@atosorigin.com>
Newsgroups: ianywhere.public.general
References: <4125cc4d$1@forums-1-dub> <412a2cc5$4@forums-2-dub>
Subject: Re: ASA 8 and 9 - DIAG [01S02] [Sybase][ODBC Driver][Adaptive Server Anywhere]Cursor option values changed (121)
Lines: 183
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2800.1437
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1441
X-Original-NNTP-Posting-Host: whitechalk.cgtec.sema.de
Message-ID: <412c84a5@forums-2-dub>
X-Original-Trace: 25 Aug 2004 05:23:01 -0700, whitechalk.cgtec.sema.de
X-Original-NNTP-Posting-Host: forums-2-dub.sybase.com
X-Original-Trace: 25 Aug 2004 05:06:51 -0700, forums-2-dub.sybase.com
NNTP-Posting-Host: forums-master.sybase.com
X-Original-NNTP-Posting-Host: forums-master.sybase.com
Date: 25 Aug 2004 05:16:55 -0700
X-Trace: forums-1-dub 1093436215 10.22.108.75 (25 Aug 2004 05:16:55 -0700)
X-Original-Trace: 25 Aug 2004 05:16:55 -0700, forums-master.sybase.com
X-Authenticated-User: ngsysop
Path: forums-1-dub!not-for-mail
Xref: forums-1-dub ianywhere.public.general:3424
Article PK: 7330

Hi,

Thanks for your answer.

the issue is not to determine the Errors.Count only but the complete
message.
I was worndering because I only see this error using the ODBC driver
(not using the Provider Statement ASAProv), using the OLE DB driver (with
Provider Statement) all is ok.
Therefore this warning only occurs using ODBC not OLE DB - and this
confuses me...

This was the meaning of uncomment the row.... becauwe then (OLE DB driver)
all is ok

Best regards
Georg Jung



"Robert Waywell" <nospam_rwaywell@ianywhere.com> schrieb im Newsbeitrag
news:412a2cc5$4@forums-2-dub...

> First point is that the SQLCode 121 indicates a warning (+ SQLCode value)
> rather than an error (- SQLCode value).
>
> The documentation explains this SQLCODE as:
>
> ASA Error Messages
>
> Database Error Messages
>
> Alphabetic list of error messages
>
> Cursor option values changed
> ...
> Probable cause
> The engine could not support the requested cursor option values for the
> associated query, and similar option settings were substituted.
> There were a number of changes made to cursor behaviour between the
7.x
> codeline and the 8.x codeline in order to improve cursor semantics to more
> closely match both the ANSI standards and other vendors. Reference to
these
> changes is made in the following section of the docs:
>
> What's New in SQL Anywhere Studio
>
> What's New in Version 8.0.0
>
> Behavior changes in version 8
>
> Adaptive Server Anywhere behavior changes
> ...
> Cursor changes A side effect of cursor enhancements is that the cursors
> in this version provide behavior closer to defined standards than before.
> This may produce cursor sensitivity changes for some cursors, as Adaptive
> Server Anywhere supplies behavior that better matches the expectations of
> ODBC and other interfaces. For example, embedded SQL SCROLL cursors now
> disallow prefetching, so that value changes are reflected in the cursor.
>
> This change may affect existing applications that check return codes only
> for SQL_SUCCESS and not SQL_SUCCESS_WITH_INFO. Applications that check for
> SQL_SUCCESS_WITH_INFO receive a warning if the cursor behavior is
different
> from that requested. The warning is SQLCODE=121, SQLSTATE 01S02.
>
> Insensitive cursors are not updatable.
>
> For more information, see Insensitive cursors.
>
> I am a bit confused by this line:
>
> > The alternative using ASAProv as a provider (uncomment the row)
>
>
> What provider are you currently using?
>
>
> --
> -----------------------------------------------
> Robert Waywell
> Sybase Adaptive Server Anywhere Developer - Version 8
> Sybase Certified Professional
>
> Sybase's iAnywhere Solutions
>
> Please respond ONLY to newsgroup
>
> EBF's and Patches: http://downloads.sybase.com
> choose SQL Anywhere Studio >> change 'time frame' to all
>
> To Submit Bug Reports:
>
http://case-express.sybase.com/cx/cx.stm?starturl=casemessage.ssc?CASETYPE=B
> ug
>
> SQL Anywhere Studio Supported Platforms and Support Status
> http://my.sybase.com/detail?id=1002288
>
> Whitepapers, TechDocs, and bug fixes are all available through the
iAnywhere
> Developer Community at www.ianywhere.com/developer
>
> "Georg Jung" <georg.jung@atosorigin.com> wrote in message
> news:4125cc4d$1@forums-1-dub...
> > Dear all,
> >
> > i have a problem with SQL Anywhere 8 and 9 (even 9.0.1.1899) using ADO
> code
> > in VB like below.
> > The reason is the combination of distinct in the Select and the cursor
> > option for the record set.
> >
> > If i took "adOpenForwardOnly" as a cursor option - all is fine
> >
> > In SQL Anywhere 6 or 7 the code below was no problem.
> >
> > The alternative using ASAProv as a provider (uncomment the row)
> > 'myConn.Provider = "ASAProv"
> > or
> > myConn.ConnectionString = _
> > "DSN=mydb;UID=dba;PWD=sql;Provider=ASAProv"
> > is a other solution - (OLEDB)
> > but why is this combination a problem only in the newer releases ?
> >
> > Hope for an answer - see example code below...
> >
> > Best regards
> > Georg
> >
> > Private Sub cmdQuery_Click()
> > ' Declare variables
> > Dim myConn As New ADODB.Connection
> > Dim myCommand As New ADODB.Command
> > Dim myRS As New ADODB.Recordset
> >
> > On Error GoTo ErrorHandler:
> >
> > ' Establish the connection
> > 'myConn.Provider = "ASAProv"
> > myConn.ConnectionString = _
> > "DSN=mydb;UID=dba;PWD=sql"
> > myConn.CursorLocation = adUseServer
> > myConn.Mode = adModeReadWrite
> > myConn.IsolationLevel = adXactCursorStability
> > myConn.Open
> >
> > 'Execute a query
> > Set myRS = New Recordset
> > myRS.CacheSize = 50
> > myRS.Source = "Select distinct col_no from table_col"
> > myRS.ActiveConnection = myConn
> > myRS.CursorType = adOpenKeyset
> > myRS.LockType = adLockOptimistic
> > myRS.Open
> > If myConn.Errors.Count > 0 Then
> > MsgBox CStr(myConn.Errors.Item(0)), vbInformation, ""
> > myRS.Close
> > myConn.Close
> > Exit Sub
> > End If
> > 'Scroll through the results
> > myRS.MoveFirst
> > Do While Not myRS.EOF
> > MsgBox myRS.Fields("col_no"), vbInformation
> > myRS.MoveNext
> > Loop
> >
> > myRS.Close
> > myConn.Close
> > Exit Sub
> > ErrorHandler:
> > MsgBox Error(Err)
> > Exit Sub
> > End Sub
> >
> >
> >
> >
>
>


Robert Waywell Posted on 2004-08-25 13:34:15.0Z
From: "Robert Waywell" <nospam_rwaywell@ianywhere.com>
Newsgroups: ianywhere.public.general
References: <4125cc4d$1@forums-1-dub> <412a2cc5$4@forums-2-dub> <412c84a5@forums-2-dub>
Subject: Re: ASA 8 and 9 - DIAG [01S02] [Sybase][ODBC Driver][Adaptive Server Anywhere]Cursor option values changed (121)
Lines: 228
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2600.0000
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2600.0000
X-Original-NNTP-Posting-Host: rwaywell-pc.sybase.com
Message-ID: <412c96c4$1@forums-2-dub>
X-Original-Trace: 25 Aug 2004 06:40:20 -0700, rwaywell-pc.sybase.com
X-Original-NNTP-Posting-Host: forums-2-dub.sybase.com
X-Original-Trace: 25 Aug 2004 06:24:11 -0700, forums-2-dub.sybase.com
NNTP-Posting-Host: forums-master.sybase.com
X-Original-NNTP-Posting-Host: forums-master.sybase.com
Date: 25 Aug 2004 06:34:15 -0700
X-Trace: forums-1-dub 1093440855 10.22.108.75 (25 Aug 2004 06:34:15 -0700)
X-Original-Trace: 25 Aug 2004 06:34:15 -0700, forums-master.sybase.com
X-Authenticated-User: ngsysop
Path: forums-1-dub!not-for-mail
Xref: forums-1-dub ianywhere.public.general:3425
Article PK: 7332

Ok,
So the question is why do you not appear to get back the SQLCode 121
when using OLEDB. One possibility is that in checking for errors, you may
not be getting warnings, but off the top of my head I can't tell you how to
retrieve SQLCode warnings using OLEDB.

Does the error count always return 0 when you are using the OLEDB
provider?

--
-----------------------------------------------
Robert Waywell
Sybase Adaptive Server Anywhere Developer - Version 8
Sybase Certified Professional

Sybase's iAnywhere Solutions

Please respond ONLY to newsgroup

EBF's and Patches: http://downloads.sybase.com
choose SQL Anywhere Studio >> change 'time frame' to all

To Submit Bug Reports:
http://case-express.sybase.com/cx/cx.stm?starturl=casemessage.ssc?CASETYPE=B
ug

SQL Anywhere Studio Supported Platforms and Support Status
http://my.sybase.com/detail?id=1002288

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

"Georg Jung" <georg.jung@atosorigin.com> wrote in message
news:412c84a5@forums-2-dub...
> Hi,
>
> Thanks for your answer.
>
> the issue is not to determine the Errors.Count only but the complete
> message.
> I was worndering because I only see this error using the ODBC driver
> (not using the Provider Statement ASAProv), using the OLE DB driver (with
> Provider Statement) all is ok.
> Therefore this warning only occurs using ODBC not OLE DB - and this
> confuses me...
>
> This was the meaning of uncomment the row.... becauwe then (OLE DB driver)
> all is ok
>
> Best regards
> Georg Jung
>
>
>
> "Robert Waywell" <nospam_rwaywell@ianywhere.com> schrieb im Newsbeitrag
> news:412a2cc5$4@forums-2-dub...
> > First point is that the SQLCode 121 indicates a warning (+ SQLCode
value)
> > rather than an error (- SQLCode value).
> >
> > The documentation explains this SQLCODE as:
> >
> > ASA Error Messages
> >
> > Database Error Messages
> >
> > Alphabetic list of error messages
> >
> > Cursor option values changed
> > ...
> > Probable cause
> > The engine could not support the requested cursor option values for the
> > associated query, and similar option settings were substituted.
> > There were a number of changes made to cursor behaviour between the
> 7.x
> > codeline and the 8.x codeline in order to improve cursor semantics to
more
> > closely match both the ANSI standards and other vendors. Reference to
> these
> > changes is made in the following section of the docs:
> >
> > What's New in SQL Anywhere Studio
> >
> > What's New in Version 8.0.0
> >
> > Behavior changes in version 8
> >
> > Adaptive Server Anywhere behavior changes
> > ...
> > Cursor changes A side effect of cursor enhancements is that the
cursors
> > in this version provide behavior closer to defined standards than
before.
> > This may produce cursor sensitivity changes for some cursors, as
Adaptive
> > Server Anywhere supplies behavior that better matches the expectations
of
> > ODBC and other interfaces. For example, embedded SQL SCROLL cursors now
> > disallow prefetching, so that value changes are reflected in the cursor.
> >
> > This change may affect existing applications that check return codes
only
> > for SQL_SUCCESS and not SQL_SUCCESS_WITH_INFO. Applications that check
for
> > SQL_SUCCESS_WITH_INFO receive a warning if the cursor behavior is
> different
> > from that requested. The warning is SQLCODE=121, SQLSTATE 01S02.
> >
> > Insensitive cursors are not updatable.
> >
> > For more information, see Insensitive cursors.
> >
> > I am a bit confused by this line:
> >
> > > The alternative using ASAProv as a provider (uncomment the row)
> >
> >
> > What provider are you currently using?
> >
> >
> > --
> > -----------------------------------------------
> > Robert Waywell
> > Sybase Adaptive Server Anywhere Developer - Version 8
> > Sybase Certified Professional
> >
> > Sybase's iAnywhere Solutions
> >
> > Please respond ONLY to newsgroup
> >
> > EBF's and Patches: http://downloads.sybase.com
> > choose SQL Anywhere Studio >> change 'time frame' to all
> >
> > To Submit Bug Reports:
> >
>
http://case-express.sybase.com/cx/cx.stm?starturl=casemessage.ssc?CASETYPE=B
> > ug
> >
> > SQL Anywhere Studio Supported Platforms and Support Status
> > http://my.sybase.com/detail?id=1002288
> >
> > Whitepapers, TechDocs, and bug fixes are all available through the
> iAnywhere
> > Developer Community at www.ianywhere.com/developer
> >
> > "Georg Jung" <georg.jung@atosorigin.com> wrote in message
> > news:4125cc4d$1@forums-1-dub...
> > > Dear all,
> > >
> > > i have a problem with SQL Anywhere 8 and 9 (even 9.0.1.1899) using ADO
> > code
> > > in VB like below.
> > > The reason is the combination of distinct in the Select and the cursor
> > > option for the record set.
> > >
> > > If i took "adOpenForwardOnly" as a cursor option - all is fine
> > >
> > > In SQL Anywhere 6 or 7 the code below was no problem.
> > >
> > > The alternative using ASAProv as a provider (uncomment the row)
> > > 'myConn.Provider = "ASAProv"
> > > or
> > > myConn.ConnectionString = _
> > > "DSN=mydb;UID=dba;PWD=sql;Provider=ASAProv"
> > > is a other solution - (OLEDB)
> > > but why is this combination a problem only in the newer releases ?
> > >
> > > Hope for an answer - see example code below...
> > >
> > > Best regards
> > > Georg
> > >
> > > Private Sub cmdQuery_Click()
> > > ' Declare variables
> > > Dim myConn As New ADODB.Connection
> > > Dim myCommand As New ADODB.Command
> > > Dim myRS As New ADODB.Recordset
> > >
> > > On Error GoTo ErrorHandler:
> > >
> > > ' Establish the connection
> > > 'myConn.Provider = "ASAProv"
> > > myConn.ConnectionString = _
> > > "DSN=mydb;UID=dba;PWD=sql"
> > > myConn.CursorLocation = adUseServer
> > > myConn.Mode = adModeReadWrite
> > > myConn.IsolationLevel = adXactCursorStability
> > > myConn.Open
> > >
> > > 'Execute a query
> > > Set myRS = New Recordset
> > > myRS.CacheSize = 50
> > > myRS.Source = "Select distinct col_no from table_col"
> > > myRS.ActiveConnection = myConn
> > > myRS.CursorType = adOpenKeyset
> > > myRS.LockType = adLockOptimistic
> > > myRS.Open
> > > If myConn.Errors.Count > 0 Then
> > > MsgBox CStr(myConn.Errors.Item(0)), vbInformation, ""
> > > myRS.Close
> > > myConn.Close
> > > Exit Sub
> > > End If
> > > 'Scroll through the results
> > > myRS.MoveFirst
> > > Do While Not myRS.EOF
> > > MsgBox myRS.Fields("col_no"), vbInformation
> > > myRS.MoveNext
> > > Loop
> > >
> > > myRS.Close
> > > myConn.Close
> > > Exit Sub
> > > ErrorHandler:
> > > MsgBox Error(Err)
> > > Exit Sub
> > > End Sub
> > >
> > >
> > >
> > >
> >
> >
>
>