Giter VIP home page Giter VIP logo

Comments (2)

kenshaw avatar kenshaw commented on May 18, 2024

ODBC connection strings are a bit tricky. Please also note that it doesn't appear you are using the actual ODBC driver, but the ADODB/OLE based ODBC driver. You need to build your version using -tags odbc to use the actual, "real" ODBC driver (also I can surmise you are on Windows... based on the info above).

So, couple notes:

  1. I haven't tried the Microsoft Access driver with ODBC, however it would work. The syntax for the DSN would actually be like this:
$ usql 'odbc+Microsoft+Access+Text+Driver+(.txt,+.csv):///?Dbq=c:\temp'
  1. You might want to try the Microsoft ACE driver instead, which works great with CSVs:
$ usql adodb://Microsoft.ACE.OLEDB.12.0/?Extended+Properties=%22Text%3BHDR=NO%3BFMT=Delimited%22
  1. I had been meaning to provide my own CSV driver, based on SQLite, but just haven't had the opportunity to implement it yet. Look for that relatively soon, in a future release.
  2. If you cannot get the ODBC driver to work directly, you can just use the \c driver params backslash command to connect by passing the exact driver parameters to the underlying ODBC driver:
$ usql
(not connected)=> \c odbc Driver={Microsoft Text Driver (*.txt; *.csv)};Dbq=c:\txtFilesFolder\;
Extensions=asc,csv,tab,txt;

Please note that this driver is used in usql, so please refer to its documentation for specifics on specifying connections strings. I don't have a Windows system to test just now, but I will make a point to try to test this to see if it works properly.

from usql.

joebo avatar joebo commented on May 18, 2024

Thanks for the reply, looking forward to the CSV driver that is part of usql

I didn't have any luck with the Microsoft Text Driver - (may be a 32bit vs 64bit thing)

The Microsoft.ACE.OLEDB.12.0 seems to work

from usql.

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.