<?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"
	>
<channel>
	<title>Comments on: ASP: Look up / translation script</title>
	<atom:link href="http://www.scriptygoddess.com/archives/2004/11/10/asp-look-up-translation-script/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.scriptygoddess.com/archives/2004/11/10/asp-look-up-translation-script/</link>
	<description></description>
	<pubDate>Sun, 20 Jul 2008 13:46:52 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.5.1</generator>
		<item>
		<title>By: Jennifer</title>
		<link>http://www.scriptygoddess.com/archives/2004/11/10/asp-look-up-translation-script/#comment-13527</link>
		<dc:creator>Jennifer</dc:creator>
		<pubDate>Mon, 06 Dec 2004 14:13:40 +0000</pubDate>
		<guid isPermaLink="false">http://www.scriptygoddess.com/archives/2004/11/10/asp-look-up-translation-script/#comment-13527</guid>
		<description>(note to self - and others dealing with this issue too) With some additional help from Marcus, I was able to get it to select specific columns - as well as fix some continuing issues with the fields being cast as numbers - when I needed it cast as a string (leading zeros get stripped when it casts the field as a number)

The trick was creating a Schema.ini file in the same directory as the csv file. There I could set the column names (and call those column names from my asp file) as well as set the length and type of the fields. &lt;a href="http://msdn.microsoft.com/library/default.asp?url=/library/en-us/odbc/htm/odbcjetschema_ini_file.asp"&gt;More info on Schema.ini files here.&lt;/a&gt;

Thank you Marcus!!!!</description>
		<content:encoded><![CDATA[<p>(note to self - and others dealing with this issue too) With some additional help from Marcus, I was able to get it to select specific columns - as well as fix some continuing issues with the fields being cast as numbers - when I needed it cast as a string (leading zeros get stripped when it casts the field as a number)</p>
<p>The trick was creating a Schema.ini file in the same directory as the csv file. There I could set the column names (and call those column names from my asp file) as well as set the length and type of the fields. <a href="http://msdn.microsoft.com/library/default.asp?url=/library/en-us/odbc/htm/odbcjetschema_ini_file.asp">More info on Schema.ini files here.</a></p>
<p>Thank you Marcus!!!!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Jennifer</title>
		<link>http://www.scriptygoddess.com/archives/2004/11/10/asp-look-up-translation-script/#comment-13311</link>
		<dc:creator>Jennifer</dc:creator>
		<pubDate>Tue, 16 Nov 2004 20:11:03 +0000</pubDate>
		<guid isPermaLink="false">http://www.scriptygoddess.com/archives/2004/11/10/asp-look-up-translation-script/#comment-13311</guid>
		<description>I still couldn't get it to select a specific row based on a "WHERE x=y"... I ended up using a simpler connection script I found &lt;a href="http://www.eggheadcafe.com/articles/20020108.asp"&gt;here&lt;/a&gt;

and then, instead of spitting out all the data - I just did

if rs(3) = "243" then
(PRINT THE LINE...)
end if

And actually, ran into some complications because the data in the rs(x) was assumed to be a number, and I was comparing it to a (number-)string. So in order to "convert" the rs(x) into a STRING, I had to do this:

Dim strNum
strNum = rs(3) &#38; ""

then I could do this:

if strNum = "1234" then
(PRINT LINE)
end if

Probably not terrible efficient technically - but thankfully the csv isn't terribly huge, so iterating through each line doesn't take more than a blink of an eye. :)</description>
		<content:encoded><![CDATA[<p>I still couldn&#8217;t get it to select a specific row based on a &#8220;WHERE x=y&#8221;&#8230; I ended up using a simpler connection script I found <a href="http://www.eggheadcafe.com/articles/20020108.asp">here</a></p>
<p>and then, instead of spitting out all the data - I just did</p>
<p>if rs(3) = &#8220;243&#8243; then<br />
(PRINT THE LINE&#8230;)<br />
end if</p>
<p>And actually, ran into some complications because the data in the rs(x) was assumed to be a number, and I was comparing it to a (number-)string. So in order to &#8220;convert&#8221; the rs(x) into a STRING, I had to do this:</p>
<p>Dim strNum<br />
strNum = rs(3) &amp; &#8220;&#8221;</p>
<p>then I could do this:</p>
<p>if strNum = &#8220;1234&#8243; then<br />
(PRINT LINE)<br />
end if</p>
<p>Probably not terrible efficient technically - but thankfully the csv isn&#8217;t terribly huge, so iterating through each line doesn&#8217;t take more than a blink of an eye. <img src='http://www.scriptygoddess.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /></p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Marcus</title>
		<link>http://www.scriptygoddess.com/archives/2004/11/10/asp-look-up-translation-script/#comment-13294</link>
		<dc:creator>Marcus</dc:creator>
		<pubDate>Sat, 13 Nov 2004 20:17:18 +0000</pubDate>
		<guid isPermaLink="false">http://www.scriptygoddess.com/archives/2004/11/10/asp-look-up-translation-script/#comment-13294</guid>
		<description>I re-sent the email. There's also an article &lt;a href="http://www.devarticles.com/index2.php?option=content&#038;task=view&#038;id=705&#038;pop=1&#038;page=0&#038;hide_js=1"&gt;here&lt;/a&gt;. Even though that one's for Java, the text driver stuff is the same.</description>
		<content:encoded><![CDATA[<p>I re-sent the email. There&#8217;s also an article <a href="http://www.devarticles.com/index2.php?option=content&#038;task=view&#038;id=705&#038;pop=1&#038;page=0&#038;hide_js=1">here</a>. Even though that one&#8217;s for Java, the text driver stuff is the same.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Jennifer</title>
		<link>http://www.scriptygoddess.com/archives/2004/11/10/asp-look-up-translation-script/#comment-13290</link>
		<dc:creator>Jennifer</dc:creator>
		<pubDate>Fri, 12 Nov 2004 20:59:39 +0000</pubDate>
		<guid isPermaLink="false">http://www.scriptygoddess.com/archives/2004/11/10/asp-look-up-translation-script/#comment-13290</guid>
		<description>Marcus - no I didn't get your email. :( I couldn't get this to work - because the only thing I was able to do was SELECT * from csvfile.csv ... I couldn't seem to get it to select a single row of data using a "WHERE field = 'value'"... it just didn't seem to recognize the field names... If you know of a way to do that - PLEASE email me!!! :D
scripty at scriptygoddess dot com</description>
		<content:encoded><![CDATA[<p>Marcus - no I didn&#8217;t get your email. <img src='http://www.scriptygoddess.com/wp-includes/images/smilies/icon_sad.gif' alt=':(' class='wp-smiley' /> I couldn&#8217;t get this to work - because the only thing I was able to do was SELECT * from csvfile.csv &#8230; I couldn&#8217;t seem to get it to select a single row of data using a &#8220;WHERE field = &#8216;value&#8217;&#8221;&#8230; it just didn&#8217;t seem to recognize the field names&#8230; If you know of a way to do that - PLEASE email me!!! <img src='http://www.scriptygoddess.com/wp-includes/images/smilies/icon_biggrin.gif' alt=':D' class='wp-smiley' /><br />
scripty at scriptygoddess dot com</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Marcus</title>
		<link>http://www.scriptygoddess.com/archives/2004/11/10/asp-look-up-translation-script/#comment-13289</link>
		<dc:creator>Marcus</dc:creator>
		<pubDate>Fri, 12 Nov 2004 20:33:36 +0000</pubDate>
		<guid isPermaLink="false">http://www.scriptygoddess.com/archives/2004/11/10/asp-look-up-translation-script/#comment-13289</guid>
		<description>Just inquiring whether you got my email reply and if the Text Driver query method worked for ya.</description>
		<content:encoded><![CDATA[<p>Just inquiring whether you got my email reply and if the Text Driver query method worked for ya.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Marcus</title>
		<link>http://www.scriptygoddess.com/archives/2004/11/10/asp-look-up-translation-script/#comment-13279</link>
		<dc:creator>Marcus</dc:creator>
		<pubDate>Wed, 10 Nov 2004 16:10:39 +0000</pubDate>
		<guid isPermaLink="false">http://www.scriptygoddess.com/archives/2004/11/10/asp-look-up-translation-script/#comment-13279</guid>
		<description>Depending on how long the lookup list is going to be, you could always save the excel file in a CSV format and use ADODB and the text driver ("Driver={Microsoft Text Driver (*.txt; *.csv)}") and even run a normal sql query on it. I.e. "SELECT thetext, thenumber FROM lookupfile.csv WHERE thetext = 'text_you_entered'". I used this for a few simple web sites where clients wanted to display their inventory and update it with ease. They just upload a new CSV file to the web server.</description>
		<content:encoded><![CDATA[<p>Depending on how long the lookup list is going to be, you could always save the excel file in a CSV format and use ADODB and the text driver (&#8221;Driver={Microsoft Text Driver (*.txt; *.csv)}&#8221;) and even run a normal sql query on it. I.e. &#8220;SELECT thetext, thenumber FROM lookupfile.csv WHERE thetext = &#8216;text_you_entered&#8217;&#8221;. I used this for a few simple web sites where clients wanted to display their inventory and update it with ease. They just upload a new CSV file to the web server.</p>
]]></content:encoded>
	</item>
</channel>
</rss>

<!-- Dynamic Page Served (once) in 0.290 seconds -->
