Page 1 of 2 12 LastLast
Results 1 to 10 of 15

Thread: conectarme desde visual foxpro a odbc lianja

  1. #1
    Member
    Join Date
    Feb 2015
    Posts
    36

    conectarme desde visual foxpro a odbc lianja

    Estoy tratando de conectarme desde Visual foxpro a la base de
    Datos de Lianja pero me manda error de conexion:


    lcDSNLess="DRIVER=Lianja ODBC Driver;" ;
    + "SERVERNAME=?;USERNAME=?;PASSWORD=?;DATABASE=C:\LI ANJA\DATA\BDFICC"
    lnConnHandle=SQLSTRINGCONNECT(lcDSNLess)
    if lnConnHandle > 0
    sqlexec(lnConnHandle,"select * from historia")
    list
    sqldisconnect(lnConnHandle)
    else
    messagebox("Sin Conexion","Error")
    endif


    Ya esta instalado el odbc driver en mi maquina.
    Tendran alguna idea de porque no me esta funcionando la
    conexion.

    Saludos

  2. #2
    Senior Member
    Join Date
    Jul 2013
    Location
    Ontario, Canada
    Posts
    658
    Hola

    Mi intento español

    ¿Hay un espacio en :
    Code:
    DATABASE=C:\LI ANJA\
                  ^
    Cory

  3. #3
    Member
    Join Date
    Feb 2015
    Posts
    36
    this is the complete string:


    lcDSNLess="DRIVER=Lianja ODBC Driver;SERVERNAME=?;USERNAME=?;PASSWORD=?;DATABASE =C:\LIANJA\DATA\BDFICC"
    lnConnHandle=SQLSTRINGCONNECT(lcDSNLess)
    if lnConnHandle > 0
    sqlexec(lnConnHandle,"select * from historia")
    list
    sqldisconnect(lnConnHandle)
    else
    messagebox("Sin Conexion","Error")
    endif

    but cant connect.
    any idea?
    Regards

  4. #4
    Lianja Team davefoss's Avatar
    Join Date
    Feb 2012
    Posts
    111
    Try:

    DATABASE=BDFICC

  5. #5
    Lianja MVP
    Join Date
    Feb 2012
    Location
    Berea, KY, USA
    Posts
    1,941
    Hi Rodolfo,

    I changed the servername to localhost, and pointed to a database on my machine, and it worked in VFP.

    hope this helps (hth),

    Hank

  6. #6
    Member
    Join Date
    Feb 2015
    Posts
    36

    can you show me the string

    can you show me the string was used for you, at this test.

    thanks and regards.

  7. #7
    Lianja MVP
    Join Date
    Feb 2012
    Location
    Berea, KY, USA
    Posts
    1,941
    Hi Rodolfo,

    From vfp9 command window:



    hth,

    Hank

  8. #8
    Lianja Development Team barrymavin's Avatar
    Join Date
    Feb 2012
    Location
    UK, USA, Thailand
    Posts
    5,769
    Development databases used in the app builder are opened non shared.

    When connecting using ODBC from VFP the ODBC driver expects the database to be deployed. It does not access the development database.

    Databases that have been deployed (runtime databases) are opened shared.
    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

  9. #9
    Lianja Development Team barrymavin's Avatar
    Join Date
    Feb 2012
    Location
    UK, USA, Thailand
    Posts
    5,769
    Which only works if the southwind database is not open by the app builder as described in my other reply.
    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

  10. #10
    Lianja MVP
    Join Date
    Feb 2012
    Location
    Berea, KY, USA
    Posts
    1,941
    Hi Barry,

    good point. Rodolfo was pointing toward the dev data directory, so I went with that.

    Hank

Page 1 of 2 12 LastLast

Tags for this Thread

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