vfox – sql connect

  1. sqlhanddle=”Driver={Mysql ODBC 3.51 Driver};dsn=hosxp;Server=localhost;Uid=sa;Pwd=sa;Database=hos”
  2. sqlcondb=SQLSTRINGCONNECT(sqlhanddle)
  3. ?sqlcondb
  4. IF sqlcondb > 0
  5. = SQLEXEC(sqlcondb,’select * from patient limit 100′ ,’patient’)
  6. = SQLEXEC(sqlcondb,’select * from ovst limit 100′ ,’ovst’)
  7. SELECT * from  patient INTO CURSOR cursor1
  8. SELECT cursor1
  9. BROWSE
  10. = SQLDISCONNECT(sqlcondb)
  11. ELSE
  12. = MESSAGEBOX(“no”,0)
  13. ENDIF
  14. RETURN