Results 1 to 5 of 5

Thread: VFP ODBC primer

  1. #1
    Senior Member
    Join Date
    Jan 2014
    Posts
    369

    VFP ODBC primer

    Hi guys

    Looking to use VFP ODBC driver to connect Lianja app to be able to add data to existing VFP table. Lots of you must have done something similar.

    Never used ODBC before and read quite a lot but the 1st steps to getting it up and running seem illusive and are never mentioned.

    1. Where can we download the VFP ODBC driver(s) from? We've downloaded and installed just about everything that says it is a VFP ODBC driver but none appear in the ODBC Data Sources in windows (32 or 64 bit even after reboot) even though there are drivers for loads of other formats, including Lianja.
    2. Once that is achieved, presumably the username and password are just left blank as "unauthenticated access" has no meaning in VFP?
    3. If the server is on the same network, how do we set up the path to the file?


    Once that is set up, using virtual tables inside Lianja is documented fairly well.

    Virtual tables look like a great idea and flexible too but is ODBC going to be more reliable than using a web service to just send the data to?

    Thanks in advance

    Simon
    Last edited by SpringBox; 2019-10-28 at 17:27.

  2. #2
    Lianja MVP
    Join Date
    Feb 2012
    Location
    Berea, KY, USA
    Posts
    2,185
    Hi Simon,

    That newest VFP ODBC Driver produced by Microsoft is for VFP6. DevArt has a driver that works for VFP9 data types, as Barry has mentioned.

    VFP ODBC drivers works just as any ODBC driver works. You just have to know the connection string properties. DevArt will supply that information. In general, www.connectionstring.com has specs for all the common drivers.

    Code:
    lcConnStr = "your connstring goes here"
    lnHandle = sqlstringconnect(lcConnStr)
    ln = sqlexec(lnHandle,"select fielda, fieldb from tablea","mycursor")
    The connstring info and the sqlexec select string can be used in a Virtual Table.

    hth,

    Hank

    PS: unless you have to keep the old code running, the better choice is to move everything over to Lianja.

    PPS: to find the VFP6 ODBC Driver, google (without the quotes) "vfp odbc driver download" I would strongly suggest getting the DevArt ODBC driver to avoid gotchas. I don't have a comprehensive list, but you can find references on the web with a little searching.
    Last edited by HankFay; 2019-10-29 at 09:08.

  3. #3
    Senior Member
    Join Date
    Jan 2014
    Posts
    369
    Thanks Hank

    That's a big help

    Simon

  4. #4
    Member
    Join Date
    Feb 2012
    Location
    Earth.Europe.Germany.Bavaria.Obing
    Posts
    47
    You should be aware though, that all those ODBC drivers are not able to run any trigger code, since they're lacking the VFP runtime to interpret that code. Therefore,if an installation relies on Triggers, don't do any Updates, Deletes or Inserts via ODBC.
    BTW: It's a similar problem with Servoy and their Java-based VFP-driver.
    wOOdy

  5. #5
    Lianja Development Team barrymavin's Avatar
    Join Date
    Feb 2012
    Location
    UK, USA, Thailand
    Posts
    7,165
    Blog Entries
    22
    Good info. Also worth pointing out is that Lianja ODBC driver is a proper client server driver using TCPIP network protocol. The server has the full Lianja engine embedded within it so stored procedures and triggers work as expected.
    Principal developer of Lianja, Recital and other products

    Follow me on:

    Twitter: http://twitter.com/lianjaInc
    Facebook: http://www.facebook.com/LianjaInc
    LinkedIn: http://www.linkedin.com/in/barrymavin

Bookmarks

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Journey into the Cloud
Join us