<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	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/"
		>
<channel>
	<title>Comments on: Running an Access Parameter Query from Excel</title>
	<atom:link href="http://datapigtechnologies.com/blog/index.php/running-an-access-parameter-query-from-excel/feed/" rel="self" type="application/rss+xml" />
	<link>http://datapigtechnologies.com/blog/index.php/running-an-access-parameter-query-from-excel/</link>
	<description>A DataPig Technologies Blog</description>
	<lastBuildDate>Wed, 08 Feb 2012 00:53:00 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.4</generator>
	<item>
		<title>By: Laurent</title>
		<link>http://datapigtechnologies.com/blog/index.php/running-an-access-parameter-query-from-excel/comment-page-2/#comment-20554</link>
		<dc:creator>Laurent</dc:creator>
		<pubDate>Fri, 23 Sep 2011 18:35:09 +0000</pubDate>
		<guid isPermaLink="false">http://datapigtechnologies.com/blog/?p=1148#comment-20554</guid>
		<description>I&#039;m having error 3265 &quot;Item not found in collection&quot;. My Query has the following cirteria:

Field: WORK ORDER: Trim([WO_HDR.WO_NUM])

Cirteria: Like [Enter WO Number  and include &quot;*&quot; at end of WO Number to include NCR WO]

It seems like the trim function is messing it up. any ideas how to get around it?</description>
		<content:encoded><![CDATA[<p>I&#8217;m having error 3265 &#8220;Item not found in collection&#8221;. My Query has the following cirteria:</p>
<p>Field: WORK ORDER: Trim([WO_HDR.WO_NUM])</p>
<p>Cirteria: Like [Enter WO Number  and include "*" at end of WO Number to include NCR WO]</p>
<p>It seems like the trim function is messing it up. any ideas how to get around it?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Kyle</title>
		<link>http://datapigtechnologies.com/blog/index.php/running-an-access-parameter-query-from-excel/comment-page-2/#comment-19225</link>
		<dc:creator>Kyle</dc:creator>
		<pubDate>Thu, 04 Aug 2011 19:01:02 +0000</pubDate>
		<guid isPermaLink="false">http://datapigtechnologies.com/blog/?p=1148#comment-19225</guid>
		<description>After having the &#039;3343 - Unrecognized Database Format&#039; error I changed my references in excel to &quot;Microsoft 12.0 Access Database Engine Object Library&quot;.  This appears to have cleared up the problem, even though references are declared as DAO they&#039;re apparently very compatible.</description>
		<content:encoded><![CDATA[<p>After having the &#8217;3343 &#8211; Unrecognized Database Format&#8217; error I changed my references in excel to &#8220;Microsoft 12.0 Access Database Engine Object Library&#8221;.  This appears to have cleared up the problem, even though references are declared as DAO they&#8217;re apparently very compatible.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Glen Powers</title>
		<link>http://datapigtechnologies.com/blog/index.php/running-an-access-parameter-query-from-excel/comment-page-2/#comment-19194</link>
		<dc:creator>Glen Powers</dc:creator>
		<pubDate>Wed, 03 Aug 2011 15:44:57 +0000</pubDate>
		<guid isPermaLink="false">http://datapigtechnologies.com/blog/?p=1148#comment-19194</guid>
		<description>Michael,

I have transcribed your code verbatim except for the name of my DB and query.

I am getting the dreaded error 3343: Unrecognized Database Format.

here are two screen shots:  1) My references and 2) the code.

Can you tell me what I need to to do to fix this problem.  I am using Excel 2007 and Access 2007.

thanks

glen

references:

MS Excel 12.0 Object Library
MS DAO 3.6 Object Library

Code:


&#039;Step 1: Declare your variables


Dim MyDatabase As DAO.Database
Dim MyQueryDef As DAO.QueryDef
Dim MyRecordSet As DAO.Recordset
Dim i As Integer

&#039;Step 2: Identify the database and query
Set MyDatabase = DBEngine.OpenDatabase _
(&quot;C:\My Documents\TRHDR1.accdb&quot;)
Set MyQueryDef = MyDatabase.QueryDefs(&quot;PARAMETERQUERY&quot;)

&#039;Step 3: Define the Parameters
With MyQueryDef
.Parameters(&quot;[Enter Name]&quot;) = Range(&quot;C1&quot;).Value
End With

&#039;Step 4: Open the Query
Set MyRecordSet = MyQueryDef.OpenRecordSet

&#039;Step 5: Clear Previous contents
Sheets(&quot;Main&quot;).Select
ActiveSheet.Range(&quot;A6:K10000&quot;).ClearContents

&#039;Step 6: Copy the recordset to Excel
ActiveSheet.Range(&quot;A7&quot;).CopyFromRecordset MyRecordSet

&#039;Step 7: Add column heading names to the spreadsheet
For i = 1 To MyRecordSet.Fields.Count
Actovesheet.Cells(6, i).Value = MyRecordSet.Fields(i - 1).Name
Next i

MsgBox &quot;Your Query has been run&quot;


End Sub</description>
		<content:encoded><![CDATA[<p>Michael,</p>
<p>I have transcribed your code verbatim except for the name of my DB and query.</p>
<p>I am getting the dreaded error 3343: Unrecognized Database Format.</p>
<p>here are two screen shots:  1) My references and 2) the code.</p>
<p>Can you tell me what I need to to do to fix this problem.  I am using Excel 2007 and Access 2007.</p>
<p>thanks</p>
<p>glen</p>
<p>references:</p>
<p>MS Excel 12.0 Object Library<br />
MS DAO 3.6 Object Library</p>
<p>Code:</p>
<p>&#8216;Step 1: Declare your variables</p>
<p>Dim MyDatabase As DAO.Database<br />
Dim MyQueryDef As DAO.QueryDef<br />
Dim MyRecordSet As DAO.Recordset<br />
Dim i As Integer</p>
<p>&#8216;Step 2: Identify the database and query<br />
Set MyDatabase = DBEngine.OpenDatabase _<br />
(&#8220;C:\My Documents\TRHDR1.accdb&#8221;)<br />
Set MyQueryDef = MyDatabase.QueryDefs(&#8220;PARAMETERQUERY&#8221;)</p>
<p>&#8216;Step 3: Define the Parameters<br />
With MyQueryDef<br />
.Parameters(&#8220;[Enter Name]&#8220;) = Range(&#8220;C1&#8243;).Value<br />
End With</p>
<p>&#8216;Step 4: Open the Query<br />
Set MyRecordSet = MyQueryDef.OpenRecordSet</p>
<p>&#8216;Step 5: Clear Previous contents<br />
Sheets(&#8220;Main&#8221;).Select<br />
ActiveSheet.Range(&#8220;A6:K10000&#8243;).ClearContents</p>
<p>&#8216;Step 6: Copy the recordset to Excel<br />
ActiveSheet.Range(&#8220;A7&#8243;).CopyFromRecordset MyRecordSet</p>
<p>&#8216;Step 7: Add column heading names to the spreadsheet<br />
For i = 1 To MyRecordSet.Fields.Count<br />
Actovesheet.Cells(6, i).Value = MyRecordSet.Fields(i &#8211; 1).Name<br />
Next i</p>
<p>MsgBox &#8220;Your Query has been run&#8221;</p>
<p>End Sub</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: datapig</title>
		<link>http://datapigtechnologies.com/blog/index.php/running-an-access-parameter-query-from-excel/comment-page-2/#comment-18803</link>
		<dc:creator>datapig</dc:creator>
		<pubDate>Tue, 19 Jul 2011 18:35:37 +0000</pubDate>
		<guid isPermaLink="false">http://datapigtechnologies.com/blog/?p=1148#comment-18803</guid>
		<description>Mark, 
Lori, 

It looks like you&#039;re trying to hit a network directory that has been mapped to your Windows Explorer as a relative drive.  In this case, you&#039;ll have to use the full absolute network path.  

For Example:  

Instead of
B:\SalesOps\AccessDatabase.accdb

I would use
\\skuspldc03\data\SalesOps\AccessDatabase.accdb</description>
		<content:encoded><![CDATA[<p>Mark,<br />
Lori, </p>
<p>It looks like you&#8217;re trying to hit a network directory that has been mapped to your Windows Explorer as a relative drive.  In this case, you&#8217;ll have to use the full absolute network path.  </p>
<p>For Example:  </p>
<p>Instead of<br />
B:\SalesOps\AccessDatabase.accdb</p>
<p>I would use<br />
\\skuspldc03\data\SalesOps\AccessDatabase.accdb</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Lori</title>
		<link>http://datapigtechnologies.com/blog/index.php/running-an-access-parameter-query-from-excel/comment-page-2/#comment-18796</link>
		<dc:creator>Lori</dc:creator>
		<pubDate>Tue, 19 Jul 2011 13:36:43 +0000</pubDate>
		<guid isPermaLink="false">http://datapigtechnologies.com/blog/?p=1148#comment-18796</guid>
		<description>I have the same problem as Mark on July 13th. Has anyone found a solution to his problem?</description>
		<content:encoded><![CDATA[<p>I have the same problem as Mark on July 13th. Has anyone found a solution to his problem?</p>
]]></content:encoded>
	</item>
</channel>
</rss>

