Results 1 to 6 of 6

Thread: About using ODBC - some examples

  1. #1
    Junior Member
    Join Date
    Feb 2012
    Location
    Italy
    Posts
    25

    Red face About using ODBC - some examples

    Hello
    I think that it will be very useful if you can upload some example on create a simple application using ODBC. I just spend some hours to use SQLzzzzz functions (first test on VFP) but there is no way to make work
    I'd like to make something very simple for the begining, like

    pn=SQLCONNECT("odbc","user","password")
    IF pn>0
    IF SQLEXEC(pn,"SELECT * from mytable","crsResult")>0
    SELECT crsResult
    BROWSE && Or waht else is the LIANJA command
    ELSE
    MESSAGEBOX("ERROR ON SQL")
    ENDIF
    ELSE
    MESSAGEBOX("NO ODBC DATA")
    ENDIF
    =SQLDISCONNECT(0)

    The problem is thatl SQCONNECT is not working (repeat on VFP it's OK). Having a DEBUG I don't understand where it is the problem

    One other point : I thought that on DATA WORKPLACE I can add an ODBC and can see the DATBASE. Why must create a Datbase adn IMPORT (even I don't see any function on Import )
    Thanks for all

  2. #2
    Lianja Support Team lianjasupport's Avatar
    Join Date
    Feb 2012
    Location
    Boston USA, Wokingham UK
    Posts
    1,259
    Thank you for raising these issues, tickets have been logged for the following:
    1. Specifying the username and password in SQLCONNECT() causes the connection to fail
    2. SQLEXEC() return value needs to be stored to a variable
    3. VFP allows SQLDISCONNECT(0) to terminate all active connections, we do not currently support it.

    Code:
    pn=SQLCONNECT("dsn")
    IF pn>0
        m_ret = SQLEXEC(pn,"SELECT * from mytable","crsResult")
         if m_ret > 0
             SELECT crsResult
             LIST
        ELSE
            MESSAGEBOX("ERROR ON SQL")
        ENDIF
        SQLDISCONNECT(pn)
    ELSE
        MESSAGEBOX("NO ODBC DATA")
    ENDIF

  3. #3
    Lianja Support Team lianjasupport's Avatar
    Join Date
    Feb 2012
    Location
    Boston USA, Wokingham UK
    Posts
    1,259
    These are all working as of beta8.

  4. #4
    Junior Member
    Join Date
    Feb 2012
    Location
    Italy
    Posts
    25
    Quote Originally Posted by lianjasupport View Post
    These are all working as of beta8.
    Beta 8 ? Not available for dowload (6 april 2012)

  5. #5
    Lianja Development Team barrymavin's Avatar
    Join Date
    Feb 2012
    Location
    UK, USA, Thailand
    Posts
    7,183
    Blog Entries
    22
    Quote Originally Posted by tabacaru View Post
    Beta 8 ? Not available for dowload (6 april 2012)
    Please see the roadmap on lianja.com. beta8 should be available next week.

  6. #6
    Junior Member
    Join Date
    Feb 2012
    Location
    Italy
    Posts
    25
    Thanks

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