GithubHelp home page GithubHelp logo

Support for Manifold GIS about odbc HOT 15 CLOSED

r-dbi avatar r-dbi commented on June 7, 2024
Support for Manifold GIS

from odbc.

Comments (15)

jimhester avatar jimhester commented on June 7, 2024

The argument name is .connection_string, note the leading period.

from odbc.

mdsumner avatar mdsumner commented on June 7, 2024

Omg, sorry - real error is

library(odbc)
mapfile <- "C:/temp/manifold.map"
dstring <- sprintf("DRIVER={Manifold Project Driver (*.map)};DBQ=%s;Unicode=True;Ansi=False;OpenGIS=True;DSN=Default;", 
normalizePath(mapfile))
dbConnect(odbc::odbc(), .connection_string  = dstring)

## Error in eval(substitute(expr), envir, enclos) : 
##  nanodbc.cpp:1003: S1C00: Requested functionality is not implemented. 

(should I just edit this issue in place above or start a new one?)

from odbc.

jimhester avatar jimhester commented on June 7, 2024

You can just leave the original post as it is, no need to edit or submit a new one.

Could you try the latest master (a5975c1), it looks like the error is occuring when odbc is trying to query the driver for information, which apparently the Manifold driver does not support.

from odbc.

mdsumner avatar mdsumner commented on June 7, 2024

There is no change, unfortunately. Is there anything I can try with RODBC that would help diagnosis?

Here are odbcGetInfo and sqlTypeInfo with RODBC:

 odbcGetInfo(con)
                                              DBMS_Name                                                DBMS_Ver                                         Driver_ODBC_Ver                                        Data_Source_Name 
"Manifold System 8.0 Ultimate Edition (build 8.0.29.0)"                                            " 8.00.0000"                                                 "02.50"                                                      "" 
                                            Driver_Name                                              Driver_Ver                                                ODBC_Ver                                             Server_Name 
                                              "Ext.dll"                                                 "error"                                                      ""                                                      "" 
> sqlTypeInfo(con)
   TYPE_NAME DATA_TYPE COLUMN_SIZE LITERAL_PREFIX LITERAL_SUFFIX CREATE_PARAMS NULLABLE CASE_SENSITIVE SEARCHABLE UNSIGNED_ATTRIBUTE FIXED_PREC_SCALE AUTO_UNIQUE_VALUE LOCAL_TYPE_NAME MINIMUM_SCALE MAXIMUM_SCALE
1        BIT        -7           1           <NA>           <NA>          <NA>        2              1          3                 NA                0                NA            <NA>            NA            NA
2    TINYINT        -6           3           <NA>           <NA>          <NA>        2              1          3                 NA                0                NA            <NA>            NA            NA
3   SMALLINT         5           5           <NA>           <NA>          <NA>        2              1          3                 NA                0                NA            <NA>            NA            NA
4        INT         4          10           <NA>           <NA>          <NA>        2              1          3                 NA                0                NA            <NA>            NA            NA
5      MONEY         8          15           <NA>           <NA>          <NA>        2              1          3                 NA                0                NA            <NA>            NA            NA
6       REAL         7           7           <NA>           <NA>          <NA>        2              1          3                 NA                0                NA            <NA>            NA            NA
7     DOUBLE         8          15           <NA>           <NA>          <NA>        2              1          3                 NA                0                NA            <NA>            NA            NA
8   DateTime        11          19              #              #          <NA>        2              1          3                 NA                0                NA            <NA>            NA            NA
9       TEXT        12  2147483646              "              "          <NA>        2              1          3                 NA                0                NA            <NA>            NA            NA
10    BINARY        -3  2147483647           <NA>           <NA>          <NA>        2              1          3                 NA                0                NA            <NA>            NA            NA

from odbc.

jimhester avatar jimhester commented on June 7, 2024

I don't see how it is possible for there to be no change, do you get the exact same error? Be sure to restart your R session after installing the new version.

Could you try setting options(error=quote(dump.frames("odbc", TRUE))), running the connection command and then attaching the odbc.rda file to this issue?

from odbc.

mdsumner avatar mdsumner commented on June 7, 2024

Yes exact, though I didn't record it. I really appreciate your patience here, I will reboot the machine just in case, but I have to wait a little to do that.

I've installed now the next commit cef3496, and restarted R and here's the result. I've zipped the dump odbc.rda just so gh will take it.

 library(odbc)

mapfile <- "C:/temp/manifold.map"
dstring <- sprintf("DRIVER={Manifold Project Driver (*.map)};DBQ=%s;Unicode=True;Ansi=False;OpenGIS=True;DSN=Default;", 
 normalizePath(mapfile))
options(error=quote(dump.frames("odbc", TRUE)))
dbConnect(odbc::odbc(), .connection_string  = dstring)
#Error in eval(substitute(expr), envir, enclos) : 
#  nanodbc.cpp:1003: S1C00: Requested functionality is not implemented. 

devtools::session_info()
Session info -------------------------------------------------------------------
 setting  value                                      
 version  R version 3.3.2 Patched (2016-11-09 r71645)
 system   x86_64, mingw32                            
 ui       Rgui                                       
 language (EN)                                       
 collate  English_Australia.1252                     
 tz       Australia/Hobart                           
 date     2016-11-15                                 

Packages -----------------------------------------------------------------------
 package  * version    date       source                         
 DBI        0.5-12     2016-10-07 Github (rstats-db/DBI@4f00863) 
 devtools   1.12.0     2016-06-24 CRAN (R 3.3.2)                 
 digest     0.6.10     2016-08-02 CRAN (R 3.3.1)                 
 memoise    1.0.0      2016-01-29 CRAN (R 3.3.0)                 
 odbc     * 0.0.0.9000 2016-11-14 Github (rstats-db/odbc@cef3496)
 Rcpp       0.12.7     2016-09-05 CRAN (R 3.3.1)                 
 withr      1.0.2      2016-06-20 CRAN (R 3.3.0)   

odbc.zip

from odbc.

jimhester avatar jimhester commented on June 7, 2024

No need to restart, please try ede57a7 and thank you for your patience, it should get past that error at least.

from odbc.

mdsumner avatar mdsumner commented on June 7, 2024

Woo, exciting. Thanks!

<OdbcConnection>  Database: C:\temp\manifold.map
  Manifold System 8.0 Ultimate Edition (build 8.0.29.0) Version:  8.00.0000

More soon

from odbc.

mdsumner avatar mdsumner commented on June 7, 2024

Here's the results from the very next steps, I do hope this is useful

library(odbc)
dstring <- "DRIVER={Manifold Project Driver (*.map)};DBQ=C:\\temp\\manifold.map;Unicode=True;Ansi=False;OpenGIS=True;DSN=Default;"
con <- dbConnect(odbc::odbc(), .connection_string  = dstring)
con
#<OdbcConnection>  Database: C:\temp\manifold.map
#Manifold System 8.0 Ultimate Edition (build 8.0.29.0) Version:  8.00.0000

## listing tables or fields gives the same error
dbListTables(con)
#Error in eval(substitute(expr), envir, enclos) : 
#  nanodbc.cpp:2059: S1092: Requested functionality is not implemented. 
dbListFields(con, "normal_table")
#Error in eval(substitute(expr), envir, enclos) : 
 # nanodbc.cpp:2059: S1092: Requested functionality is not implemented. 

## read a table, different error
dbReadTable(con, "normal_table")
#Error in eval(substitute(expr), envir, enclos) : 
# nanodbc.cpp:1526: HY092: [Microsoft][ODBC Driver Manager] Option type out of range 

## non-existent table, new error
dbSendQuery(con, "SELECT * FROM [normal_tabl]")
#Error in eval(substitute(expr), envir, enclos) : 
#  nanodbc.cpp:1289: 42000: Unknown table [normal_tabl]. 


## this table does exist, same error for dbReadTable
dbSendQuery(con, "SELECT * FROM [normal_table]")
#Error in eval(substitute(expr), envir, enclos) : 
#  nanodbc.cpp:1526: HY092: [Microsoft][ODBC Driver Manager] Option type out of range 

from odbc.

jimhester avatar jimhester commented on June 7, 2024

It was helpful, but I don't think the Manifold driver implements enough of the ODBC spec to be useable with nanodbc, which is what the odbc package uses to interface with the ODBC drivers.

Rewriting nanodbc to make it compatible would require a significant time investment, as would implementing the functionality directly, so I don't think you are going to be able to use the odbc package with manifold databases.

If you want a DBI compatible interface I would recommend using RODBCDBI.

from odbc.

mdsumner avatar mdsumner commented on June 7, 2024

Ok thanks.

from odbc.

mdsumner avatar mdsumner commented on June 7, 2024

Really appreciate your efforts here, there's a clear feature request/bug report here for Manifold.

In case this is of interest to anyone else, I'd already started the RODBCDBI path, though my attempts at dplyr integration were patchy: https://github.com/r-gris/dplyrodbc/blob/master/R/src_manifold.r

Also FYI: I tried using Microsoft Access from 32-bit R with odbc and it works no problem. That is a useful reference for me to pursue this elsewhere.

## this is 32-bit R 
library(DBI)
con <- dbConnect(odbc::odbc(),
  .connection_string = "DBQ=C:\\temp\\Mtcars.mdb;Driver={Microsoft Access Driver (*.mdb)};DriverId=25;FIL=MS Access;MaxBufferSize=2048;PageTimeout=5;UID=admin;")
 dbListTables(con)
#[1] "MSysAccessObjects" "MSysACEs"          "MSysObjects"       "MSysQueries"       "MSysRelationships" "Mtcars"           
dbListFields(con, "Mtcars")
# [1] "mpg"  "cyl"  "disp" "hp"   "drat" "wt"   "qsec" "vs"   "am"   "gear" "carb"
#dbReadTable(con, "Mtcars")

from odbc.

jimhester avatar jimhester commented on June 7, 2024

A short update on this, we now support backends that don't support transactions, so you may want to try Manifold again with the devel version devtools::install_github("rstats-db/odbc"). It may still fail due to other missing functionality though...

from odbc.

mdsumner avatar mdsumner commented on June 7, 2024

Thanks appreciate the heads up, I'll follow up when I get a chance.

This does work in Radian which has been out for a couple months now, but again I haven't had time to explore it.

from odbc.

jimhester avatar jimhester commented on June 7, 2024

I am going to close this for now, if in the future you are interested in looking into this again please comment on the issue.

from odbc.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.