How to use Visual Foxpro ODBC drivers to connect to SAP B1 Hana? The good answer

Here is an example of code on how to connect from VFP to the SAP B1 HANA database :

vconnect = SQLSTRINGCONNECT("DRIVER={HDBODBC32};UID=YOURUSERNAME;PWD=YOURPASSWORD;SERVERNODE=SERVER_IP:30015;CS=YOURDATABASENAMEI")

m.sql = 'SELECT "CardCode" AS PNCFA,"AddID" AS PSIREN FROM OCRD'

lnRetVal = SQLExec(vconnect, m.sql,'zsap_ocrd')
If lnRetVal < 0
Aerror(arr)
Messagebox(arr[1,2])
Endif

SQLDisconnect(vconnect)

The only problem is that Foxpro will ask you to confirm the login to the Database.

I have not figured why yet.... do you have any idea ?

35o7i.png (21.5 kB)
Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

0 Answers

Skip to Content