<?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>nandeshwar.info &#187; ODBC</title>
	<atom:link href="http://nandeshwar.info/tag/odbc/feed/" rel="self" type="application/rss+xml" />
	<link>http://nandeshwar.info</link>
	<description></description>
	<lastBuildDate>Wed, 18 Aug 2010 19:24:47 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Linked Table Query Returning Incorrect Results</title>
		<link>http://nandeshwar.info/2010/08/18/linked-table-query-returning-incorrect-results/</link>
		<comments>http://nandeshwar.info/2010/08/18/linked-table-query-returning-incorrect-results/#comments</comments>
		<pubDate>Wed, 18 Aug 2010 19:24:47 +0000</pubDate>
		<dc:creator>a7n9</dc:creator>
				<category><![CDATA[Access]]></category>
		<category><![CDATA[error]]></category>
		<category><![CDATA[linked tables]]></category>
		<category><![CDATA[ODBC]]></category>
		<category><![CDATA[SQL server]]></category>

		<guid isPermaLink="false">http://nandeshwar.info/?p=325</guid>
		<description><![CDATA[We had this annoying problem: a simple query in Access to a linked table (using ODBC and MS SQL server) returned incorrect results, though the same query returned correct results in MS SQL server. By incorrect I mean the field values were different, so rather than returning AZ, the query returned BZ (some other value [...]]]></description>
			<content:encoded><![CDATA[<p>We had this annoying problem: a simple query in Access to a linked table (using ODBC and MS SQL server) returned incorrect results, though the same query returned correct results in MS SQL server. By incorrect I mean the field values were different, so rather than returning AZ, the query returned BZ (some other value in that field).</p>
<p>We thought that it was a table size issue, may be the driver could not handle huge data. However, the problem was with the &#8220;unique record identifier&#8221; while linking the table, as JM reported <a href="http://bytes.com/topic/access/answers/209274-simple-query-linked-odbc-table-gives-wrong-results">here</a>. I did not have this problem any longer when I did not select any fields for the unique record identifier while linking the table.</p>
<div class='bookmarkify'><a name='bookmarkify'></a><div class='title' title='Use these links to share this page with others'>Share</div><div class='linkbuttons'><a href='http://www.citeulike.org/posturl?url=http://nandeshwar.info/2010/08/18/linked-table-query-returning-incorrect-results/&amp;title=Linked Table Query Returning Incorrect Results' title='Save to CiteULike' onclick='target="_blank";' rel='nofollow'><img src='http://nandeshwar.info/wp-content/plugins/bookmarkify/citeulike.png' style='width:16px; height:16px;' alt='[CiteULike] ' /></a> <a href='http://del.icio.us/post?url=http://nandeshwar.info/2010/08/18/linked-table-query-returning-incorrect-results/&amp;title=Linked Table Query Returning Incorrect Results' title='Save to del.icio.us' onclick='target="_blank";' rel='nofollow'><img src='http://nandeshwar.info/wp-content/plugins/bookmarkify/delicious.png' style='width:16px; height:16px;' alt='[del.icio.us] ' /></a> <a href='http://digg.com/submit?phase=2&amp;url=http://nandeshwar.info/2010/08/18/linked-table-query-returning-incorrect-results/&amp;title=Linked Table Query Returning Incorrect Results' title='Digg It!' onclick='target="_blank";' rel='nofollow'><img src='http://nandeshwar.info/wp-content/plugins/bookmarkify/digg.png' style='width:16px; height:16px;' alt='[Digg] ' /></a> <a href='http://www.facebook.com/share.php?u=http://nandeshwar.info/2010/08/18/linked-table-query-returning-incorrect-results/' title='Save to Facebook' onclick='target="_blank";' rel='nofollow'><img src='http://nandeshwar.info/wp-content/plugins/bookmarkify/facebook.png' style='width:16px; height:16px;' alt='[Facebook] ' /></a> <a href='http://www.furl.net/storeIt.jsp?u=http://nandeshwar.info/2010/08/18/linked-table-query-returning-incorrect-results/&amp;t=Linked Table Query Returning Incorrect Results' title='Save to Furl' onclick='target="_blank";' rel='nofollow'><img src='http://nandeshwar.info/wp-content/plugins/bookmarkify/furl.png' style='width:16px; height:16px;' alt='[Furl] ' /></a> <a href='http://www.google.com/bookmarks/mark?op=edit&amp;output=popup&amp;bkmk=http://nandeshwar.info/2010/08/18/linked-table-query-returning-incorrect-results/&amp;title=Linked Table Query Returning Incorrect Results' title='Save to Google Bookmarks' onclick='target="_blank";' rel='nofollow'><img src='http://nandeshwar.info/wp-content/plugins/bookmarkify/google.png' style='width:16px; height:16px;' alt='[Google] ' /></a> <a href='http://reddit.com/submit?url=http://nandeshwar.info/2010/08/18/linked-table-query-returning-incorrect-results/&amp;title=Linked Table Query Returning Incorrect Results' title='Reddit' onclick='target="_blank";' rel='nofollow'><img src='http://nandeshwar.info/wp-content/plugins/bookmarkify/reddit.png' style='width:16px; height:16px;' alt='[Reddit] ' /></a> <a href='http://slashdot.org/bookmark.pl?url=http://nandeshwar.info/2010/08/18/linked-table-query-returning-incorrect-results/&amp;title=Linked Table Query Returning Incorrect Results' title='Slashdot It!' onclick='target="_blank";' rel='nofollow'><img src='http://nandeshwar.info/wp-content/plugins/bookmarkify/slashdot.png' style='width:16px; height:16px;' alt='[Slashdot] ' /></a> <a href='http://www.stumbleupon.com/submit?url=http://nandeshwar.info/2010/08/18/linked-table-query-returning-incorrect-results/&amp;title=Linked Table Query Returning Incorrect Results' title='Stumble It!' onclick='target="_blank";' rel='nofollow'><img src='http://nandeshwar.info/wp-content/plugins/bookmarkify/stumbleupon.png' style='width:16px; height:16px;' alt='[StumbleUpon] ' /></a> <a href='http://technorati.com/faves?add=http://nandeshwar.info/2010/08/18/linked-table-query-returning-incorrect-results/' title='Add to my Technorati Favorites' onclick='target="_blank";' rel='nofollow'><img src='http://nandeshwar.info/wp-content/plugins/bookmarkify/technorati.png' style='width:16px; height:16px;' alt='[Technorati] ' /></a> <a href='http://twitter.com/home/?status=Linked Table Query Returning Incorrect Results+http://nandeshwar.info/2010/08/18/linked-table-query-returning-incorrect-results/' title='Save to Twitter' onclick='target="_blank";' rel='nofollow'><img src='http://nandeshwar.info/wp-content/plugins/bookmarkify/twitter.png' style='width:16px; height:16px;' alt='[Twitter] ' /></a> <a href='http://www.feedburner.com/fb/a/emailFlare?itemTitle=Linked Table Query Returning Incorrect Results&amp;uri=http://nandeshwar.info/2010/08/18/linked-table-query-returning-incorrect-results/&amp;loc=en_US' title='Email this to a friend' onclick='target="_blank";' rel='nofollow'><img src='http://nandeshwar.info/wp-content/plugins/bookmarkify/email.png' style='width:16px; height:16px;' alt='[Email] ' /></a>  <a title='See more bookmark and sharing options...' href='http://nandeshwar.info/2010/08/18/linked-table-query-returning-incorrect-results/#bookmarkify' rel='nofollow'><small>More&nbsp;&raquo;</small></a></div><div class='brand'><small><a href='http://www.bookmarkify.com/'>Powered by Bookmarkify&trade;</a></small></div></div>]]></content:encoded>
			<wfw:commentRss>http://nandeshwar.info/2010/08/18/linked-table-query-returning-incorrect-results/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Access VBA: Export Access tables using ODBC</title>
		<link>http://nandeshwar.info/2007/07/18/access-vba-export-access-tables-using-odbc/</link>
		<comments>http://nandeshwar.info/2007/07/18/access-vba-export-access-tables-using-odbc/#comments</comments>
		<pubDate>Wed, 18 Jul 2007 20:28:00 +0000</pubDate>
		<dc:creator>a7n9</dc:creator>
				<category><![CDATA[Access]]></category>
		<category><![CDATA[Useful Procedures]]></category>
		<category><![CDATA[ODBC]]></category>
		<category><![CDATA[VBA]]></category>

		<guid isPermaLink="false">http://a7n9.wordpress.com/2007/07/18/access-vba-export-access-tables-using-odbc/</guid>
		<description><![CDATA[If you want to export Access tables using ODBC/DSN connections, use the following code. This procedure uses the File DSN and ODBC connection to export Access tables using DAO object TableDef.
Sub ExportTbls()
Dim sTblNm As String
Dim sTypExprt As String
Dim sCnxnStr  As String, vStTime As Variant
Dim db As Database, tbldef As DAO.TableDef
On Error GoTo ExportTbls_Error
sTypExprt = [...]]]></description>
			<content:encoded><![CDATA[<p>If you want to export Access tables using ODBC/DSN connections, use the following code. This procedure uses the File DSN and ODBC connection to export Access tables using DAO object TableDef.</p>
<div id="code"><span style="font-family: Courier;"><span style="color:#00007F;">Sub</span> ExportTbls()</span></p>
<p><span style="color:#00007F;"><span style="font-family: Courier;">Dim</span></span><span style="font-family: Courier;"> sTblNm <span style="color:#00007F;">As</span> <span style="color:#00007F;">String</span><br />
<span style="color:#00007F;">Dim</span> sTypExprt <span style="color:#00007F;">As</span> <span style="color:#00007F;">String</span><br />
<span style="color:#00007F;">Dim</span> sCnxnStr  <span style="color:#00007F;">As</span> <span style="color:#00007F;">String</span>, vStTime <span style="color:#00007F;">As</span> <span style="color:#00007F;">Variant</span><br />
<span style="color:#00007F;">Dim</span> db <span style="color:#00007F;">As</span> Database, tbldef <span style="color:#00007F;">As</span> DAO.TableDef</span></p>
<p><span style="color:#00007F;"><span style="font-family: Courier;">On</span></span><span style="font-family: Courier;"> <span style="color:#00007F;">Error</span> <span style="color:#00007F;">GoTo</span> ExportTbls_Error</span></p>
<p><span style="font-family: Courier;">sTypExprt = &#8220;ODBC Database&#8221; <span style="color:#007F00;">&#8216;Export Type</span><br />
sCnxnStr = &#8220;ODBC;DSN=DSNName;UID=userID;PWD=password&#8221; <span style="color:#007F00;">&#8216;Create the connection string</span></span></p>
<p><span style="font-family: Courier;">vStTime = Timer<br />
Application.Echo <span style="color:#00007F;">False</span>, &#8220;Visual Basic code is executing.&#8221;</span></p>
<p><span style="color:#00007F;"><span style="font-family: Courier;">Set</span></span><span style="font-family: Courier;"> db = CurrentDb()</span></p>
<p><span style="color:#007F00;"><span style="font-family: Courier;">&#8216;need a reference to Microsoft DAO 3.x library</span></span><span style="font-family: Courier;"><br />
<span style="color:#00007F;">For</span> <span style="color:#00007F;">Each</span> tbldef <span style="color:#00007F;">In</span> db.TableDefs<br />
<span style="color:#007F00;">&#8216;Don&#8217;t export System and temporary tables</span><br />
<span style="color:#00007F;">If</span> Left(tbldef.Name, 4)  &#8220;MSys&#8221; And Left(tbldef.Name, 4)  &#8220;~TMP&#8221; <span style="color:#00007F;">Then</span><br />
<span style="color:#007F00;">&#8216;Debug.Print tbldef.Name</span><br />
sTblNm = tbldef.Name<br />
DoCmd.TransferDatabase acExport, sTypExprt, sCnxnStr, acTable, sTblNm, sTblNm<br />
<span style="color:#00007F;">End</span> <span style="color:#00007F;">If</span><br />
<span style="color:#00007F;">Next</span> tbldef</span></p>
<p><span style="font-family: Courier;">MsgBox &#8220;Done! Time taken=&#8221; &amp; Timer &#8211; vStTime</span></p>
<p><span style="color:#00007F;"><span style="font-family: Courier;">On</span></span><span style="font-family: Courier;"> <span style="color:#00007F;">Error</span> <span style="color:#00007F;">GoTo</span> 0<br />
SmoothExit_ExportTbls:<br />
<span style="color:#00007F;">Set</span> db = <span style="color:#00007F;">Nothing</span><br />
Application.Echo <span style="color:#00007F;">True</span><br />
<span style="color:#00007F;">Exit</span> <span style="color:#00007F;">Sub</span></span></p>
<p><span style="font-family: Courier;">ExportTbls_Error:<br />
MsgBox &#8220;Error &#8221; &amp; Err.Number &amp; &#8221; (&#8221; &amp; Err.Description &amp; &#8220;) in procedure ExportTblsODST&#8221;<br />
<span style="color:#00007F;">Resume</span> SmoothExit_ExportTbls<br />
<span style="color:#00007F;">End</span> <span style="color:#00007F;">Sub</span></span></div>
<div class='bookmarkify'><a name='bookmarkify'></a><div class='title' title='Use these links to share this page with others'>Share</div><div class='linkbuttons'><a href='http://www.citeulike.org/posturl?url=http://nandeshwar.info/2007/07/18/access-vba-export-access-tables-using-odbc/&amp;title=Access VBA: Export Access tables using ODBC' title='Save to CiteULike' onclick='target="_blank";' rel='nofollow'><img src='http://nandeshwar.info/wp-content/plugins/bookmarkify/citeulike.png' style='width:16px; height:16px;' alt='[CiteULike] ' /></a> <a href='http://del.icio.us/post?url=http://nandeshwar.info/2007/07/18/access-vba-export-access-tables-using-odbc/&amp;title=Access VBA: Export Access tables using ODBC' title='Save to del.icio.us' onclick='target="_blank";' rel='nofollow'><img src='http://nandeshwar.info/wp-content/plugins/bookmarkify/delicious.png' style='width:16px; height:16px;' alt='[del.icio.us] ' /></a> <a href='http://digg.com/submit?phase=2&amp;url=http://nandeshwar.info/2007/07/18/access-vba-export-access-tables-using-odbc/&amp;title=Access VBA: Export Access tables using ODBC' title='Digg It!' onclick='target="_blank";' rel='nofollow'><img src='http://nandeshwar.info/wp-content/plugins/bookmarkify/digg.png' style='width:16px; height:16px;' alt='[Digg] ' /></a> <a href='http://www.facebook.com/share.php?u=http://nandeshwar.info/2007/07/18/access-vba-export-access-tables-using-odbc/' title='Save to Facebook' onclick='target="_blank";' rel='nofollow'><img src='http://nandeshwar.info/wp-content/plugins/bookmarkify/facebook.png' style='width:16px; height:16px;' alt='[Facebook] ' /></a> <a href='http://www.furl.net/storeIt.jsp?u=http://nandeshwar.info/2007/07/18/access-vba-export-access-tables-using-odbc/&amp;t=Access VBA: Export Access tables using ODBC' title='Save to Furl' onclick='target="_blank";' rel='nofollow'><img src='http://nandeshwar.info/wp-content/plugins/bookmarkify/furl.png' style='width:16px; height:16px;' alt='[Furl] ' /></a> <a href='http://www.google.com/bookmarks/mark?op=edit&amp;output=popup&amp;bkmk=http://nandeshwar.info/2007/07/18/access-vba-export-access-tables-using-odbc/&amp;title=Access VBA: Export Access tables using ODBC' title='Save to Google Bookmarks' onclick='target="_blank";' rel='nofollow'><img src='http://nandeshwar.info/wp-content/plugins/bookmarkify/google.png' style='width:16px; height:16px;' alt='[Google] ' /></a> <a href='http://reddit.com/submit?url=http://nandeshwar.info/2007/07/18/access-vba-export-access-tables-using-odbc/&amp;title=Access VBA: Export Access tables using ODBC' title='Reddit' onclick='target="_blank";' rel='nofollow'><img src='http://nandeshwar.info/wp-content/plugins/bookmarkify/reddit.png' style='width:16px; height:16px;' alt='[Reddit] ' /></a> <a href='http://slashdot.org/bookmark.pl?url=http://nandeshwar.info/2007/07/18/access-vba-export-access-tables-using-odbc/&amp;title=Access VBA: Export Access tables using ODBC' title='Slashdot It!' onclick='target="_blank";' rel='nofollow'><img src='http://nandeshwar.info/wp-content/plugins/bookmarkify/slashdot.png' style='width:16px; height:16px;' alt='[Slashdot] ' /></a> <a href='http://www.stumbleupon.com/submit?url=http://nandeshwar.info/2007/07/18/access-vba-export-access-tables-using-odbc/&amp;title=Access VBA: Export Access tables using ODBC' title='Stumble It!' onclick='target="_blank";' rel='nofollow'><img src='http://nandeshwar.info/wp-content/plugins/bookmarkify/stumbleupon.png' style='width:16px; height:16px;' alt='[StumbleUpon] ' /></a> <a href='http://technorati.com/faves?add=http://nandeshwar.info/2007/07/18/access-vba-export-access-tables-using-odbc/' title='Add to my Technorati Favorites' onclick='target="_blank";' rel='nofollow'><img src='http://nandeshwar.info/wp-content/plugins/bookmarkify/technorati.png' style='width:16px; height:16px;' alt='[Technorati] ' /></a> <a href='http://twitter.com/home/?status=Access VBA: Export Access tables using ODBC+http://nandeshwar.info/2007/07/18/access-vba-export-access-tables-using-odbc/' title='Save to Twitter' onclick='target="_blank";' rel='nofollow'><img src='http://nandeshwar.info/wp-content/plugins/bookmarkify/twitter.png' style='width:16px; height:16px;' alt='[Twitter] ' /></a> <a href='http://www.feedburner.com/fb/a/emailFlare?itemTitle=Access VBA: Export Access tables using ODBC&amp;uri=http://nandeshwar.info/2007/07/18/access-vba-export-access-tables-using-odbc/&amp;loc=en_US' title='Email this to a friend' onclick='target="_blank";' rel='nofollow'><img src='http://nandeshwar.info/wp-content/plugins/bookmarkify/email.png' style='width:16px; height:16px;' alt='[Email] ' /></a>  <a title='See more bookmark and sharing options...' href='http://nandeshwar.info/2007/07/18/access-vba-export-access-tables-using-odbc/#bookmarkify' rel='nofollow'><small>More&nbsp;&raquo;</small></a></div><div class='brand'><small><a href='http://www.bookmarkify.com/'>Powered by Bookmarkify&trade;</a></small></div></div>]]></content:encoded>
			<wfw:commentRss>http://nandeshwar.info/2007/07/18/access-vba-export-access-tables-using-odbc/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
