SqlExec() is alive!!!!

This forum is meant for questions about the Visual FoxPro Language support in X#.

Post Reply
Anonymous

SqlExec() is alive!!!!

Post by Anonymous »

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:
.

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
Post Reply