Page 1 of 3 123 LastLast
Results 1 to 10 of 21

Thread: Select fron a vfp table that is not part of a database

  1. #1
    Senior Member
    Join Date
    Apr 2012
    Location
    United Kingdom
    Posts
    657

    Select fron a vfp table that is not part of a database

    I am writing some code to create/update lianja tables from my Xcase model.

    I need to be able to do select statements from Lianja against the vfp table created by xcase so I can scan though and do the work needed to crate / update table, create indexes in Lianja etc.

    Since the tables don't belong to a datatbase what is the best way to do this? I assume I have to have database to use ODBC?

    I have tried with a test table ( this one does belong to a database)

    select * from c:\1temp\daddress into cursor temp1

    and get an error

    Fri Apr 7 18:12:12 2017
    **** Lianja error ****
    DADDRESS.LA10AUTHOR
    ^
    Fatal I/O error writing record 1 to table - errno 22



    David Le Mesurier

  2. #2
    Senior Member
    Join Date
    Feb 2012
    Location
    Rome - Italy
    Posts
    1,893
    Hi David,
    in my opinion, the best thing is to create an ODBC link to your xcase table, then create a VT on that table.

    With a old FoxPro table, I do that.

    ciao
    Fabio

  3. #3
    Senior Member
    Join Date
    Apr 2012
    Location
    United Kingdom
    Posts
    657
    Hi Fabio,

    Can you make ODBC links to tables that are not part of a database?

    The code I have looked at for the ODBC connection wants the name of the database
    David

  4. #4
    Lianja MVP
    Join Date
    Dec 2012
    Location
    Croatia, Zagreb
    Posts
    1,135
    Hi David,

    For free VFP table you need VFP ODBC driver.

    Read these posts:
    http://www.lianja.com/community/show...FP-ODBC-Driver
    or in [Answers] collection
    http://www.lianja.com/community/show...FP-ODBC-Driver

    When you install correct driver, you can create VFP ODBC connection

    The windows ODBC utility will be located in different locations depending if you are using a 32 bit or 64 bit system.
    32 bit: C:\Windows\System32\odbcad32.exe
    64 bit: C:\Windows\SysWOW64\odbcad32.exe

    Josip

  5. #5
    Senior Member
    Join Date
    Apr 2012
    Location
    United Kingdom
    Posts
    657
    Thanks Josip,

    I'll take a look at that

    David

  6. #6
    Lianja MVP
    Join Date
    Dec 2012
    Location
    Croatia, Zagreb
    Posts
    1,135
    Hi David,

    In the link I mentioned there is an interesting post regarding VFPOLEDB.
    Don't know what was result, but interesting alternative maybe for quick and dirty work, if you don't have ODBC driver installed yet...

    ---------
    Q:
    I know vfpoledb is really just activex.. Are there any issues using vfpoledb to connect to my vfp tables and doing updates... I'm going to be running parallel with our old system... I was told that lianja itself can open vfp tables and update them, however, the indexes don't update...
    A:
    I have not tried it but if you install the vfpoledb driver then in Lianja;
    Code:
    
    SET DEBUG ON
    vfpda = createObject("OLEDB.Connection")
    I'd be interested to see if it loads and what is in debug_client.txt
    -----

    Josip
    Last edited by josipradnik; 2017-04-07 at 12:13.

  7. #7
    Senior Member
    Join Date
    Apr 2012
    Location
    United Kingdom
    Posts
    657
    I've just tried to copy one of the tables to a Lianja table using
    use c:\1temp\ddent noupdate
    copy to c:\1temp\l_ddent with production

    and get

    Fri Apr 7 21:10:46 2017
    **** Lianja error ****
    copy to c:\1temp\l_ddent with production
    ^
    ERROR - invalid record length

    Hank tells me that the Xcase case tables are in foxpro 2.x rather than VFP type so maybe that is an issue.

    David

  8. #8
    Lianja MVP
    Join Date
    Dec 2012
    Location
    Croatia, Zagreb
    Posts
    1,135
    Fabio worked with 2.x
    Memo was the problem. Type General instead, as I understand.

    ---
    I'm try to access FoxPro 2.6 data. From console, if I write:
    use E:\cogema\dati\articoli
    the table are opened correctly, I can use this way?
    I've also try to configure ODBC to access the data through ODBC, then I've created a VT.
    The first time, I've opened the table... then, close and open Lianja, the table is showed as "Encrypted".. Why?
    A:
    Read/Write to FoxPro tables is not supported. You should be able to import it into a Lianja database
    'encrypted' will be displayed if there is a problem with the VT and the data cannot be accessed.
    Try closing the database and deleting the VT files in the C:\Lianja\data\cogema\ folder, then rebuild the VT.
    Q2:
    Found! the problem is the MEMO field... now I try to reinsert the general.

    ----

    Josip

  9. #9
    Senior Member
    Join Date
    Apr 2012
    Location
    United Kingdom
    Posts
    657
    Thanks Josip

    There are a lot of memo fields in DDENT,

    How would one copy it then if it has memo fields?

    David

  10. #10
    Lianja Development Team barrymavin's Avatar
    Join Date
    Feb 2012
    Location
    UK, USA, Thailand
    Posts
    7,165
    Blog Entries
    22
    Hi David,

    Send me the table attached to a ticket and I will investigate.

    Lianja can read VFP and FP tables so that should not be an issue. It must be something else.
    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