<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>bobpeers -&#62; blog &#187; timestamp</title>
	<atom:link href="http://blog.bobpeers.com/tag/timestamp/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.bobpeers.com</link>
	<description>Better late than never</description>
	<lastBuildDate>Fri, 24 Jun 2011 12:34:48 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>Insert TimeStamp Into Access Using C#.NET and C++.NET</title>
		<link>http://blog.bobpeers.com/2009/11/11/insert-timestamp-into-access-using-c-hash-net-and-cpp-net/</link>
		<comments>http://blog.bobpeers.com/2009/11/11/insert-timestamp-into-access-using-c-hash-net-and-cpp-net/#comments</comments>
		<pubDate>Wed, 11 Nov 2009 08:02:35 +0000</pubDate>
		<dc:creator>Bob Peers</dc:creator>
				<category><![CDATA[Computing]]></category>
		<category><![CDATA[Windows]]></category>
		<category><![CDATA[access]]></category>
		<category><![CDATA[c++.net]]></category>
		<category><![CDATA[timestamp]]></category>

		<guid isPermaLink="false">http://blog.bobpeers.com/2009/11/11/insert-timestamp-into-access-using-c-hash-net-and-cpp-net/</guid>
		<description><![CDATA[There&#8217;s a rather strange difference between using C#.NET and C++.NET when using a parameter query to insert a TimeStamp into an MS Access database (field type Date/Time). The following C# code works perfectly. OleDbCommand cmd = new OleDbCommand(); cmd.Parameters.Add("@login_timestamp", OleDbType.DBTimeStamp).Value = DateTime.Now.ToString(); cmd.CommandText = "insert into myTable values (?)"; However when converting the same code [...]]]></description>
			<content:encoded><![CDATA[<p>There&#8217;s a rather strange difference between using C#.NET and C++.NET when using a parameter query to insert a TimeStamp into an MS Access database (field type Date/Time).</p>
<p>The following C# code works perfectly.</p>
<pre>OleDbCommand cmd = new OleDbCommand();
cmd.Parameters.Add("@login_timestamp", OleDbType.DBTimeStamp).Value = DateTime.Now.ToString();
cmd.CommandText = "insert into myTable values (?)";
</pre>
<p>However when converting the same code to C++ you cannot just use OleDbType::DBTimeStamp as this results in an error when inserting the data, instead you have to use OleDbType::Date so the code looks like this.</p>
<pre>OleDbCommand ^cmd;
cmd=gcnew OleDbCommand();
cmd->Parameters->Add("@login_timestamp", OleDbType::Date)->Value = DateTime::Now;
cmd->CommandText = "insert into myTable values (?)";
</pre>
<p><!--[if IE]><iframe frameborder="0" allowTransparency="true" class="addtoany_special_service twitter_tweet" src="http://platform.twitter.com/widgets/tweet_button.html?url=http%3A%2F%2Fblog.bobpeers.com%2F2009%2F11%2F11%2Finsert-timestamp-into-access-using-c-hash-net-and-cpp-net%2F&amp;counturl=http%3A%2F%2Fblog.bobpeers.com%2F2009%2F11%2F11%2Finsert-timestamp-into-access-using-c-hash-net-and-cpp-net%2F&amp;count=none&amp;text=Insert%20TimeStamp%20Into%20Access%20Using%20C%23.NET%20and%20C%2B%2B.NET" scrolling="no" style="border:none;overflow:hidden;width:55px;height:20px"></iframe><![endif]--><!--[if !IE]><!--><iframe class="addtoany_special_service twitter_tweet" src="http://platform.twitter.com/widgets/tweet_button.html?url=http%3A%2F%2Fblog.bobpeers.com%2F2009%2F11%2F11%2Finsert-timestamp-into-access-using-c-hash-net-and-cpp-net%2F&amp;counturl=http%3A%2F%2Fblog.bobpeers.com%2F2009%2F11%2F11%2Finsert-timestamp-into-access-using-c-hash-net-and-cpp-net%2F&amp;count=none&amp;text=Insert%20TimeStamp%20Into%20Access%20Using%20C%23.NET%20and%20C%2B%2B.NET" scrolling="no" style="border:none;overflow:hidden;width:55px;height:20px"></iframe><!--<![endif]--><!--[if IE]><iframe frameborder="0" allowTransparency="true" class="addtoany_special_service facebook_like" src="http://www.facebook.com/plugins/like.php?href=http%3A%2F%2Fblog.bobpeers.com%2F2009%2F11%2F11%2Finsert-timestamp-into-access-using-c-hash-net-and-cpp-net%2F&amp;layout=button_count&amp;show_faces=false&amp;width=75&amp;action=like&amp;colorscheme=light&amp;height=20&amp;ref=addtoany" scrolling="no" style="border:none;overflow:hidden;width:90px;height:21px"></iframe><![endif]--><!--[if !IE]><!--><iframe class="addtoany_special_service facebook_like" src="http://www.facebook.com/plugins/like.php?href=http%3A%2F%2Fblog.bobpeers.com%2F2009%2F11%2F11%2Finsert-timestamp-into-access-using-c-hash-net-and-cpp-net%2F&amp;layout=button_count&amp;show_faces=false&amp;width=75&amp;action=like&amp;colorscheme=light&amp;height=20&amp;ref=addtoany" scrolling="no" style="border:none;overflow:hidden;width:90px;height:21px"></iframe><!--<![endif]--><!--[if IE]><iframe frameborder="0" allowTransparency="true" class="addtoany_special_service google_plusone" src="https://plusone.google.com/u/0/_/%2B1/fastbutton?url=http%3A%2F%2Fblog.bobpeers.com%2F2009%2F11%2F11%2Finsert-timestamp-into-access-using-c-hash-net-and-cpp-net%2F&amp;size=medium&amp;count=false" scrolling="no" style="border:none;overflow:hidden;width:32px;height:20px"></iframe><![endif]--><!--[if !IE]><!--><iframe class="addtoany_special_service google_plusone" src="https://plusone.google.com/u/0/_/%2B1/fastbutton?url=http%3A%2F%2Fblog.bobpeers.com%2F2009%2F11%2F11%2Finsert-timestamp-into-access-using-c-hash-net-and-cpp-net%2F&amp;size=medium&amp;count=false" scrolling="no" style="border:none;overflow:hidden;width:32px;height:20px"></iframe><!--<![endif]--><a class="a2a_button_google_bookmarks" href="http://www.addtoany.com/add_to/google_bookmarks?linkurl=http%3A%2F%2Fblog.bobpeers.com%2F2009%2F11%2F11%2Finsert-timestamp-into-access-using-c-hash-net-and-cpp-net%2F&amp;linkname=Insert%20TimeStamp%20Into%20Access%20Using%20C%23.NET%20and%20C%2B%2B.NET" title="Google Bookmarks" rel="nofollow" target="_blank"><img src="http://blog.bobpeers.com/wp-content/plugins/add-to-any/icons/google.png" width="16" height="16" alt="Google Bookmarks"/></a><a class="a2a_button_evernote" href="http://www.addtoany.com/add_to/evernote?linkurl=http%3A%2F%2Fblog.bobpeers.com%2F2009%2F11%2F11%2Finsert-timestamp-into-access-using-c-hash-net-and-cpp-net%2F&amp;linkname=Insert%20TimeStamp%20Into%20Access%20Using%20C%23.NET%20and%20C%2B%2B.NET" title="Evernote" rel="nofollow" target="_blank"><img src="http://blog.bobpeers.com/wp-content/plugins/add-to-any/icons/evernote.png" width="16" height="16" alt="Evernote"/></a><a class="a2a_button_google_gmail" href="http://www.addtoany.com/add_to/google_gmail?linkurl=http%3A%2F%2Fblog.bobpeers.com%2F2009%2F11%2F11%2Finsert-timestamp-into-access-using-c-hash-net-and-cpp-net%2F&amp;linkname=Insert%20TimeStamp%20Into%20Access%20Using%20C%23.NET%20and%20C%2B%2B.NET" title="Google Gmail" rel="nofollow" target="_blank"><img src="http://blog.bobpeers.com/wp-content/plugins/add-to-any/icons/gmail.png" width="16" height="16" alt="Google Gmail"/></a><a class="a2a_button_hotmail" href="http://www.addtoany.com/add_to/hotmail?linkurl=http%3A%2F%2Fblog.bobpeers.com%2F2009%2F11%2F11%2Finsert-timestamp-into-access-using-c-hash-net-and-cpp-net%2F&amp;linkname=Insert%20TimeStamp%20Into%20Access%20Using%20C%23.NET%20and%20C%2B%2B.NET" title="Hotmail" rel="nofollow" target="_blank"><img src="http://blog.bobpeers.com/wp-content/plugins/add-to-any/icons/live.png" width="16" height="16" alt="Hotmail"/></a><a class="a2a_button_wordpress" href="http://www.addtoany.com/add_to/wordpress?linkurl=http%3A%2F%2Fblog.bobpeers.com%2F2009%2F11%2F11%2Finsert-timestamp-into-access-using-c-hash-net-and-cpp-net%2F&amp;linkname=Insert%20TimeStamp%20Into%20Access%20Using%20C%23.NET%20and%20C%2B%2B.NET" title="WordPress" rel="nofollow" target="_blank"><img src="http://blog.bobpeers.com/wp-content/plugins/add-to-any/icons/wordpress.png" width="16" height="16" alt="WordPress"/></a><a class="a2a_button_linkedin" href="http://www.addtoany.com/add_to/linkedin?linkurl=http%3A%2F%2Fblog.bobpeers.com%2F2009%2F11%2F11%2Finsert-timestamp-into-access-using-c-hash-net-and-cpp-net%2F&amp;linkname=Insert%20TimeStamp%20Into%20Access%20Using%20C%23.NET%20and%20C%2B%2B.NET" title="LinkedIn" rel="nofollow" target="_blank"><img src="http://blog.bobpeers.com/wp-content/plugins/add-to-any/icons/linkedin.png" width="16" height="16" alt="LinkedIn"/></a><a class="a2a_button_facebook" href="http://www.addtoany.com/add_to/facebook?linkurl=http%3A%2F%2Fblog.bobpeers.com%2F2009%2F11%2F11%2Finsert-timestamp-into-access-using-c-hash-net-and-cpp-net%2F&amp;linkname=Insert%20TimeStamp%20Into%20Access%20Using%20C%23.NET%20and%20C%2B%2B.NET" title="Facebook" rel="nofollow" target="_blank"><img src="http://blog.bobpeers.com/wp-content/plugins/add-to-any/icons/facebook.png" width="16" height="16" alt="Facebook"/></a><a class="a2a_button_delicious" href="http://www.addtoany.com/add_to/delicious?linkurl=http%3A%2F%2Fblog.bobpeers.com%2F2009%2F11%2F11%2Finsert-timestamp-into-access-using-c-hash-net-and-cpp-net%2F&amp;linkname=Insert%20TimeStamp%20Into%20Access%20Using%20C%23.NET%20and%20C%2B%2B.NET" title="Delicious" rel="nofollow" target="_blank"><img src="http://blog.bobpeers.com/wp-content/plugins/add-to-any/icons/delicious.png" width="16" height="16" alt="Delicious"/></a><a class="a2a_dd a2a_target addtoany_share_save" href="http://www.addtoany.com/share_save#url=http%3A%2F%2Fblog.bobpeers.com%2F2009%2F11%2F11%2Finsert-timestamp-into-access-using-c-hash-net-and-cpp-net%2F&amp;title=Insert%20TimeStamp%20Into%20Access%20Using%20C%23.NET%20and%20C%2B%2B.NET" id="wpa2a_2"><img src="http://blog.bobpeers.com/wp-content/plugins/add-to-any/share_save_171_16.png" width="171" height="16" alt="Share"/></a></p>]]></content:encoded>
			<wfw:commentRss>http://blog.bobpeers.com/2009/11/11/insert-timestamp-into-access-using-c-hash-net-and-cpp-net/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

