Invalid Data Source Name

B

Bryan Richardson

[Note: parts of this message were removed to make it a legal post.]

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|
<do something with 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
 
A

Adam Shelly

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|
<do something with file>
end

my guess is that the exception is coming from your mysterious <do
something with file>, since I can't recreate the behavior no matter
what filename I pass, even an invalid one.
 
B

Bryan Richardson

[Note: parts of this message were removed to make it a legal post.]

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 "<do something with file> section of the code. Sorry for the useless
post!!! -- BTR
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,968
Messages
2,570,153
Members
46,699
Latest member
AnneRosen

Latest Threads

Top