PDA

View Full Version : About using ODBC - some examples



tabacaru
2012-02-27, 15:10
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

lianjasupport
2012-02-28, 05:40
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.


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

lianjasupport
2012-04-03, 20:13
These are all working as of beta8.

tabacaru
2012-04-06, 07:11
These are all working as of beta8.
Beta 8 ? Not available for dowload (6 april 2012)

barrymavin
2012-04-06, 07:37
Beta 8 ? Not available for dowload (6 april 2012)
Please see the roadmap on lianja.com. beta8 should be available next week.

tabacaru
2012-04-07, 09:27
Thanks :)