SqlExec() is alive!!!!
Posted: Wed Apr 22, 2020 11:08 pm
What a great day!! I installed ver 2.4, and the first thing I did was test SqlExec(). Ka-boom! Works like a charm! Good work X# team.
This code will look very familiar to any VFP coder:
.
This code will look very familiar to any VFP coder:
.
Code: Select all
FUNCTION TestSqlQuery AS VOID
VAR connString = "driver={Sql Server}; server=192.168.X.XXSQLEXPRESS; database=XXXX; uid=XXXX; pwd=XXXX;"
VAR nHandle = SqlStringConnect(connString)
VAR cSql = "Select * From Customers Order by CustomerNo"
VAR nResult = SqlExec(nHandle, cSql, "csrSqlQuery1")
FIELD CustomerNo, Company && Add this to make compiler happy when we reference field names in Scan statement.
SCAN
? CustomerNo + ": " + Company
ENDSCAN
ENDFUNC