Issue 8753 - [SAS][SAS ODBC Driver]Function sequence error
Summary: [SAS][SAS ODBC Driver]Function sequence error
Status: CLOSED FIXED
Alias: None
Product: Base
Classification: Application
Component: code (show other issues)
Version: OOo 1.1 RC4
Hardware: PC Windows 2000
: P3 Trivial (vote)
Target Milestone: ---
Assignee: marc.neumann
QA Contact: issues@dba
URL:
Keywords: oooqa
Depends on:
Blocks:
 
Reported: 2002-10-27 22:10 UTC by prholland
Modified: 2013-08-07 15:45 UTC (History)
5 users (show)

See Also:
Issue Type: DEFECT
Latest Confirmation in: ---
Developer Difficulty: ---


Attachments
Dr Watson error log file for SAS ADO error (54.17 KB, text/plain)
2003-01-04 21:17 UTC, prholland
no flags Details

Note You need to log in before you can comment on or make changes to this issue.
Description prholland 2002-10-27 22:10:39 UTC
SAS ODBC Driver v8.2 gives error:
  [SAS][SAS ODBC Driver]Function sequence error
when attempting ODBC-setup access to SAS datasets using the following setup 
(under Win2000 and WinMe):
  Tools..Data Sources
    General: Name=SASUSER, Database type=ODBC,
             Data source URL=sdbc:odbc: SASUSER
    ODBC: User name=phil, no password required, no driver settings,
          Character set=System
    Tables: All required tables can be seen in list
  Data..DataPilot..Start
    Data source registered in OpenOffice.org
      Database=SASUSER, Data source=SHELP.CLASS, Type=Sheet

Data can be viewed for Database type=Spreadsheet or dBase.

Useful information about SAS ODBC:
(1) supports SQLExtendedFetch function, and SQLSetSmtOption allows you to set 
the rowset size and to select row-wise or column-wise binding.
(2) supports the scalar string functions: ASCII, CHAR, CONCAT, LCASE, LTRIM, 
REPEAT, REPLACE, RTRIM, SOUNDEX, SPACE, SUBSTRING, UCASE.
(3) supports the scalar numeric functions: ABS, ACOS, ASIN, ATAN, CEILING, COS, 
EXP, FLOOR, LOG, LOG10, MOD, POWER, RAND1, ROUND, SIGN, SQRT, TAN.
(4) supports the scalar timedate functions: CURDATE, CURTIME, DAYNAME, 
DAYOFMONTH, DAYOFWEEK, DAYOFYEAR, HOUR, MINUTE, MONTH, MONTHNAME, MON, QUARTER, 
SECOND, YEAR.
(5) does not support the following fDescTypes for the SQLColAttributes: 
SQL_COLUMN_OWNER_NAME, SQL_COLUMN_TABLE_NAME.
(6) uses the TCP/IP protocol to access SAS data.

HTH....Phil Holland
Comment 1 marc.neumann 2002-11-28 15:06:13 UTC
Hi,

Please be so kind and provide any more infos for this. 

- What database is SAS.
- Does this also happend when you use the beamer.

Bye Marc
Comment 2 prholland 2002-11-28 23:06:28 UTC
Marc,

In answer to your questions:
- SAS is a software system developed by SAS Institute (Cary, NC, USA -
 www.sas.com), which includes its own programming languages, but also 
stores data in its own proprietary data files.  They provide an ODBC 
Driver to access their data from external applications, eg. VB, 
Access, Excel, 1-2-3, Approach, but I wanted to demonstrate it was 
also possible from OOo Calc for a book I'm currently writing.
- The error message is obtained from F4 (I presume this is what you 
called the beamer), as well as from the DataPilot.

I suspect you may have difficulty getting hold of a copy of the SAS 
System, so I'll be very pleased to test any solutions you can suggest 
on my own licensed copies of SAS v8 and SAS v6.

Please also note that I have also raised a problem report with SAS 
Institute (ref: uk1015973), as the error message may have been caused 
by OOo Calc requesting information from the SAS ODBC Driver that it 
can't cope with.  I have found that the error message appears when 
accessing SAS v8 or SAS v6 data files, which suggests that the 
problem is localised to the ODBC Driver, and not the SAS System.  It 
should also be noted that all the names of the tables (SAS data 
files) that are available through the ODBC Driver can be viewed both 
through the beamer and the DataPilot, but they cannot be opened.

HTH......Phil Holland
Comment 3 prholland 2002-12-06 20:51:26 UTC
Marc,

Is it possible to provide details of what data is sent to the ODBC 
Driver from OOo Calc when you try to open a table in the beamer?  I 
could then pass that information to the SAS Institute developers who 
are also investigating this problem.

Thanks.......Phil Holland
Comment 4 ocke.janssen 2003-01-02 13:51:34 UTC
Hi Phil,

does the SAS driver also supports SQLFetchScroll calls? Or in other
words which ODBC version does SAS support and which version of
OpenOffice do you use?


Best regards,

Ocke
Comment 5 ocke.janssen 2003-01-02 14:04:31 UTC
Hi Phil,

I just found an article from SAS how to convert ODBC into ADO accessing.
http://www2.sas.com/proceedings/sugi26/p012-26.pdf on the second page

Your connection string should look like

PROVIDER=Microsoft.Jet.OLEDB.4.0;DATA SOURCE=your server
id;Location=your.com


Best regards,

Ocke
Comment 6 prholland 2003-01-04 21:17:50 UTC
Created attachment 4207 [details]
Dr Watson error log file for SAS ADO error
Comment 7 prholland 2003-01-04 21:19:54 UTC
Ocke,

I'm not sure which ODBC version SAS supports, as there are mentions 
of ODBC 3, but only references to docs for ODBC 2.  The driver does 
not support cursors, as the SAS System does not suppor real cursor 
functionality, but there are mentions of SQLExtendedFetch, which 
suggests only ODBC 2 support.

Because I wasn't certain which end of the connection the problem lay, 
I reported a problem with the SAS support team too, which went all 
the way to the developers.  They have now confirmed that OOo Calc has 
exposed a bug in the SAS ODBC Driver, so my interest now is in trying 
to find a workaround, hence my interest in what OOo actually sends to 
the ODBC interface.  BTW I've tried my connections to the SAS ODBC 
Driver using 1.0.1 and 643 getting the same error messages, which 
made me suspect that the problem wasn't with OOo.

Re the ADO connection to SAS, the string for SAS should look like
    Provider=SAS.LocalProvider.1;Data Source=c:\temp\sas\
but with Calc 1.0.1 and 643 I get an unrecoverable error in 
soffice.exe (see attached file).  Maybe this is another bug?

........Phil
Comment 8 ocke.janssen 2003-01-06 07:27:49 UTC
Hi Phil,

the problem could that we use the ODBC call SQLFetchScroll which was
first introduced in ODBC 3.0. But that should not be any problem as
the reference says "When working with an ODBC 2.x driver, the Driver
Manager maps this function to SQLExtendedFetch". Perhaps the
developers could have a look into the code of OOo. 

http://dba.openoffice.org/source/browse/dba/connectivity/source/drivers/odbc/OResultSet.cxx?rev=1.52&content-type=text/x-cvsweb-markup


The GPF with ADO is really bad, but without driver I think I'm unable
to reproduce the bug. But as I know the sources for ADO changes a
little bit, may be this bug will be fixed in a next release :-) which
would be the same a win at a lottery.:-)

Best regards,

Ocke
Comment 9 marc.neumann 2003-02-18 09:49:46 UTC
set target
Comment 10 Rainer Bielefeld 2003-09-27 09:28:56 UTC
Hi,

I have some questions concerning further handling of this issue.

1. Still actual?
2. Can we change status to NEW?
3. Is there any danger that the reported bug also might cause problems
   for database access to other known ODBC databases?

I deleted the funny "URL" 'sdbc:odbc: SASUSER'

Rainer
Comment 11 prholland 2003-09-28 20:53:11 UTC
Rainer,

In answer to your questions:
1. The problem still exists in 1.1rc4.  According to contacts I have 
in the SAS Institute (the developers of the SAS ODBC Driver 
software), the driver is only compliant with ODBC 2, not ODBC 3.  
However, the SAS tables can be accessed via the SAS ODBC driver from 
MS-Access 2000, MS-Excel 2000, Lotus 1-2-3 9.5 and Lotus Approach 
9.5! 
2. What is the difference between UNCONFIRMED and NEW? 
3. Yes, if this issue indicates that OOo Calc has problems accessing 
ODBC 2 data sources, then it could be affecting access to other ODBC 
2 databases. 

Note that the 'funny' URL "sdbc:odbc: SASUSER" is the name of the 
ODBC Data Source.  The 'SASUSER' string is user-defined, but 
the 'sdbc:odbc:' part is very relevant! 

If you need to carry out any tests on the OOo-SAS ODBC interface, 
then I'm more than happy to assist you in any way I can. 

.........Phil Holland
Comment 12 Rainer Bielefeld 2003-09-29 06:19:01 UTC
Deleted URL because not accessible.
Further comments soon.

Rainer
Comment 13 hans_werner67 2004-02-02 12:13:42 UTC
change subcomponent to 'none'
Comment 14 marc.neumann 2005-01-03 16:20:05 UTC
Hi,

can someone test this issue in the current developer build? 
The current developer build can be found at
http://download.openoffice.org/680/index.html

Bye Marc
Comment 15 prholland 2005-01-15 17:19:36 UTC
I raised this error as a problem with both OOo and SAS Institute.  The bug in 
the SAS ODBC Driver was resolved in version 9.01.00.218.  The OOo ODBC 
interface was expecting ODBC 3 compliance, which was stated in the SAS ODBC 
Driver documentation from version 8, but not fully achieved until version 
9.01.00.218.  This version of the SAS ODBC Driver has been tested successfully 
with OOo 1.1.4 and 1.9.65.

Issue 8753 should be marked as CLOSED and VERIFIED, without any requirements 
for changes to OOo.
Comment 16 thackert 2005-01-16 12:41:33 UTC
thackert -> prholland: Could you be so kind and close this issue yourself then?
Comment 17 prholland 2005-01-16 16:58:42 UTC
I like to close it, but I don't seem to have anywhere on my view of the issue 
to change the STATUS.

.........Phil
Comment 18 ocke.janssen 2005-01-17 07:02:30 UTC
Hi Phil,

that are great news. Thanks for testing. Closing it now.

Best regards,

Ocke
Comment 19 ocke.janssen 2005-01-17 07:02:43 UTC
.