cancel
Showing results for 
Search instead for 
Did you mean: 

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

patrice_vigier
Participant
0 Kudos

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 ?

Accepted Solutions (0)

Answers (0)