Quantcast
Channel: VFPX
Viewing all articles
Browse latest Browse all 3798

New Post: Using Parameters with SQLExec

$
0
0
SQLExec(goCnct.nHnd,[Insert Into UPResID ("id","desc","newid","reservedid") Values ('mytest123456',?This.oRecord.desc,?This.oRecord.newid,?This.oRecord.reservedid)],"",laCnt)
I could not find the above idea documented anywhere in the VFP help file. This allows you to avoid SQL injection by using parameters for values not just with the where clause. As you can see I am using properties from an object and it get correctly inserted into the database. It also solves the problem where character data contains and SQL delimiter. I think some discussion about should be added to the VFP documentation.

Viewing all articles
Browse latest Browse all 3798

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>