Marie-
Your syntax looks correct. Is it possible that m.AgLoc really is empty?
Another possibility is that m.AgLoc is the wrong data type. It might be a good idea to check the return value from SQLEXEC() with code such as:
lnResult = SQLEXEC(nconnhndl, m.cStatement)
IF lnResult < 0
* Insert error handling code here, or SET STEP ON if in development mode.
ENDIF
By the way, I've never tried using the "m." syntax in parameterizing SQL. I doubt that's the problem, but if you can unambiguously use simply "?AgLoc" you might try that too.
zahid
>I have to copy a very large number of records to an existing table on a SQL Server from a VFP 6.0 table. I have no problem moving numeric constants to SQL, but can't seem to get the syntax right to move the character data over. Below is my statement:
>
>m.cStatement = "INSERT into Producercodes (iAgencyID, cAgencyLocation,) Values (1, ?m.AgLoc)"
>
>m.AgLoc being the value in cAgencyLocation.
>
>When I run =SQLEXEC(nconnhndl, m.cStatement) the iAgencyID field on the SQL server table is populated with 1, but cAgencyLocation remains blank.
>
>Suggestions?
>
>Marie