How to attach vapor barrier to foundation wall?

I want to attach a 20 mil vapor barrier about 2 feet up the foundation wall in my crawlspace. What is a good way to do this?
I have seen/heard of two methods:
(1) use a ramset (gun that fires a nail) to attach a strip of wood on the wall pinning the vapor barrier under the strip
(2) drill holes on the cement wall with hammerdrill, then use some sort of nylon fastener to attach the vapor barrier
Which method is best (or more code compliant)? Are there other methods?
Also, what kind of sealant/glue can I use to make the vapor barrier on-wall somewhat air tight? I don't want water vapor from under the vapor barrier to come out along the wall and attack the wood structure above.
Add pictures here
<% if( /^image/.test(type) ){ %>
<% } %>
<%-name%>
Add image file
Upload

polyurethane caulk
Add pictures here
<% if( /^image/.test(type) ){ %>
<% } %>
<%-name%>
Add image file
Upload

over ground and up the wall to seal moisure down and out.
Add pictures here
<% if( /^image/.test(type) ){ %>
<% } %>
<%-name%>
Add image file
Upload

HomeOwnersHub.com is a website for homeowners and building and maintenance pros. It is not affiliated with any of the manufacturers or service providers discussed here. All logos and trade names are the property of their respective owners.