cConnString = "Driver={SQL Server};server=YourServerName;uid=sa;pwd=YourPassWord;database=YourDataBase" nSQLHandle = SQLSTRINGCONNECT(cConnString)Parameterized procedures and calling SQL Server functions and/or stored procedures:
cSQL = [EXEC InsertRecord ?thisform.MainID,?cNewPhone,?@thisform.TNID] nStat = SQLEXEC(nSQLHandle,cSQL)Note the use of "?@" for the return value from the procedure "InsertRecord" or whatever your names are.
cSQL = [SELECT * FROM YourTable WHERE SomeField='some value'] nStat = SQLEXEC(nSQLHandle,cSQL,"CursorAlias")You can do UPDATE statements via SQLEXEC also.
cSQL = [UPDATE YourTable SET SomeField='some value' WHERE KeyField=?YourKey] nStat = SQLEXEC(nSQLHandle,cSQL)If you check the return values of nStat from a SQLEXEC call and it's not a value of 1, then you'll need to use AERROR() to see what happened on the SQL side.
SQLDISCONNECT(nSQLHandle)