<?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>Bryan's Dev Blog &#187; java</title>
	<atom:link href="http://bryanlangdon.com/blog/category/java/feed/" rel="self" type="application/rss+xml" />
	<link>http://bryanlangdon.com/blog</link>
	<description></description>
	<lastBuildDate>Thu, 18 Dec 2008 16:59:13 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.4</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Using a Microsoft Access database with a Security workgroup file from Java</title>
		<link>http://bryanlangdon.com/blog/2007/03/22/using-a-microsoft-access-database-with-a-security-workgroup-file-from-java/</link>
		<comments>http://bryanlangdon.com/blog/2007/03/22/using-a-microsoft-access-database-with-a-security-workgroup-file-from-java/#comments</comments>
		<pubDate>Thu, 22 Mar 2007 20:28:06 +0000</pubDate>
		<dc:creator>Bryan Langdon</dc:creator>
				<category><![CDATA[java]]></category>

		<guid isPermaLink="false">http://bryanlangdon.com/blog/?p=19</guid>
		<description><![CDATA[This is short and simple, but it took me forever to find this solution online so I&#8217;m posting it.
Situation is this:  you need to access a Microsoft Access database from Java, and the database has workgroup security on it.
Connection conn;
String pathToDb =  &#8220;path/dbfile.mdb&#8221;;
String pathToWorkgroupFile = &#8220;path/Security.mdw&#8221;;
String userName = &#8220;user name&#8221;;
String userPassword = &#8220;user [...]]]></description>
			<content:encoded><![CDATA[<p>This is short and simple, but it took me forever to find this solution online so I&#8217;m posting it.</p>
<p>Situation is this:  you need to access a Microsoft Access database from Java, and the database has workgroup security on it.</p>
<blockquote><p>Connection conn;</p>
<p>String pathToDb =  &#8220;path/dbfile.mdb&#8221;;</p>
<p>String pathToWorkgroupFile = &#8220;path/Security.mdw&#8221;;</p>
<p>String userName = &#8220;user name&#8221;;</p>
<p>String userPassword = &#8220;user password&#8221;;</p>
<p>try{</p>
<blockquote><p>Class.forName(&#8221;sun.jdbc.odbc.JdbcOdbcDriver&#8221;).newInstance();</p></blockquote>
<blockquote><p>String conStr = &#8220;jdbc:odbc:;DRIVER=Microsoft Access Driver (*.mdb);DBQ=&#8221;+pathToDb+&#8221;;SystemDB=&#8221;+pathToWorkgroupFile+&#8221;";</p></blockquote>
<blockquote><p>conn = DriverManager.getConnection(conStr,user,pass);</p></blockquote>
<p>}catch (SQLException se){</p>
<blockquote><p>System.out.println(&#8221;Problem connecting to database: &#8220;+se);</p></blockquote>
<p>}catch (Exception ex){}</p></blockquote>
<p>Thing that took me so long to find was &#8220;SystemDB&#8221; parameter name in the connection string.  So there it is as another reference.</p>
]]></content:encoded>
			<wfw:commentRss>http://bryanlangdon.com/blog/2007/03/22/using-a-microsoft-access-database-with-a-security-workgroup-file-from-java/feed/</wfw:commentRss>
		<slash:comments>86</slash:comments>
		</item>
	</channel>
</rss>
