# Invalid Data Source Name

**URL:** <https://www.ruby-forum.com/t/invalid-data-source-name/123819>\
**Category:** Ruby\
**Created:** [December 20, 2007, 10:42pm UTC](https://www.ruby-forum.com/t/invalid-data-source-name/123819 "2007-12-20T22:42:39Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![roxah](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/54ee81/32.png) [@roxah](https://www.ruby-forum.com/u/roxah)\
**Post date:** [December 20, 2007, 10:42pm UTC](https://www.ruby-forum.com/t/invalid-data-source-name/123819/1 "2007-12-20T22:42:39Z")

</div>

Hello,

Does anyone know what causes the “Invalid Data Source Name” exception?  
I  
get this from OptionParser. Here’s my code:

opts = OptionParser.new  
opts.on(’–load-file FILE’) do |file|  
  
end

begin  
opts.parse!(ARGV)  
rescue Exception =\> e  
puts e, “”, opts  
exit 0  
end

when I run this, I get the following output:

#:~/devel$ ./program --load-file test.txt  
Invalid Data Source Name

Usage: program [options]  
– load-file FILE  
#:~/devel$

Any suggestions?! Thanks! – BTR

---

<div class="post-metadata">

**Author:** ![roxah](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/54ee81/32.png) [@roxah](https://www.ruby-forum.com/u/roxah)\
**Post date:** [December 20, 2007, 11:09pm UTC](https://www.ruby-forum.com/t/invalid-data-source-name/123819/2 "2007-12-20T23:09:35Z")

</div>

On 12/20/07, Bryan R. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> Hello,
> 
> Does anyone know what causes the “Invalid Data Source Name” exception? I  
> get this from OptionParser. Here’s my code:
> 
> opts = OptionParser.new  
> opts.on(‘–load-file FILE’) do |file|  
>   
> end

my guess is that the exception is coming from your mysterious , since I can’t recreate the behavior no matter  
what filename I pass, even an invalid one.

---

<div class="post-metadata">

**Author:** ![roxah](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/54ee81/32.png) [@roxah](https://www.ruby-forum.com/u/roxah)\
**Post date:** [December 21, 2007, 12:46am UTC](https://www.ruby-forum.com/t/invalid-data-source-name/123819/3 "2007-12-21T00:46:38Z")

</div>

Thanks for responding. Actually, I’m an idiot and wasn’t passing  
“DB:PG:”  
along with the name of my database. You are correct in that the problem  
was  
in my " section of the code. Sorry for the  
useless  
post!!! – BTR
