Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Newbie - $DBI::VERSION error 1

Status
Not open for further replies.

Kavius

Programmer
Apr 11, 2002
322
CA
I have finally caved in and am trying to learn Perl. I though a good way to do it would be to work on an already existant system. Apparently that was a bad idea.

I have the code set up and running but everytime I hit the first script:
[tt]
DBI object version 1.37 does not match $DBI::VERSION 1.14 at C:/Perl/lib/DynaLoader.pm line 249.
BEGIN failed--compilation aborted at C:/Perl/lib/DBI.pm line 182.
Compilation failed in require at C:/Perl/lib/C4/Database.pm line 25.
BEGIN failed--compilation aborted at C:/Perl/lib/C4/Database.pm line 25.
Compilation failed in require at C:/Perl/lib/C4/Auth.pm line 25.
BEGIN failed--compilation aborted at C:/Perl/lib/C4/Auth.pm line 25.
Compilation failed in require at c:\dev\ line 6.
BEGIN failed--compilation aborted at c:\dev\ line 6.
[/tt]
I am starting to suspect that this is due to the code being written for a mySQL database and me trying to point it at a SQLServer database.

Can anyone point me in the right direction for this error? (I think I bit off more than I can chew)

_______________________________________
Ignorance is a beautiful thing:
You don't know what you can't do...
 
Your suspicions are correct. The connection code for mySql is totally different than SqlServer. By the way, SqlServer is a Micosoft product and is running on a Windows server so you may encounter additional problems.

Check out CPAN.ORG for the correct DBI module for SqlServer. The documentation and usage syntax will be there also.

FYI - a great place to start learning PERL is with O'Reilly's books "Learning Perl","Programming Perl",Programming the Perl DBI","CGI Programming With Perl", and "The Perl Cookbok". All excellent books and well worth the modest price. Besides, you'll want to keep them around for future reference.

There's always a better way. The fun is trying to find it!
 
Usually, I just jump into a language (with a decent reference). I just haven't been shopping for books lately (counting my pennies for a vacation). Things like Programming the PerlDBI look very interesting. I'll be all over that.

Thanks for reminding me. I have an old book out there for developing CGI (and it uses perl as the language). I should have remembered that book. Never read it, its probably out of date, but that shouldn't matter for the first bit.

Now its time for me to pay up and fix my question to answer ratio. Thanks for the help.


_______________________________________
Ignorance is a beautiful thing:
You don't know what you can't do...
 
Several things:

Perl's DBI can talk to a Micro$oft SQL server - I've got this running in production at the moment, although not without a few late nights. You need the Sybase drivers and one of FreeTDS or SybPerl.

The code will need some tweaking to move between the two but it's not a nightmare.

The messages you are getting point towards a broken installation rather than anything that you are trying to do. The Dynaloader is trying to dynamically load fragments of code and is not getting the bits it expects: it looks as if someone may have tried to manually update a DBD driver. The safest way to cure this is a reinstallation of the various DBD packages on your system.

Good luck,

fish



"As soon as we started programming, we found to our surprise that it wasn't as easy to get programs right as we had thought. Debugging had to be discovered. I can remember the exact instant when I realized that a large part of my life from then on was going to be spent in finding mistakes in my own programs."
--Maurice Wilkes
 
I liked the first answer better.

This was the original suspicion I had. Will try uninstalling/reinstalling DBD packages again.

I'm also just going to switch over to mySQL database. That way I can keep this little adventure down to one problem at a time. I can also go ask another group for help specific to this system.


_______________________________________
Ignorance is a beautiful thing:
You don't know what you can't do...
 
That was rude of me...

Sorry fishiface, I only like the first answer better because I have a feeling it will be easier to fix.



_______________________________________
Ignorance is a beautiful thing:
You don't know what you can't do...
 
Don't worry!

I do 60% of my work with Tim Bunce's DBI module and the other 61% with Lincoln D. Stein's CGI module so do post here if you hit further problems.

Yours,


fish,

"As soon as we started programming, we found to our surprise that it wasn't as easy to get programs right as we had thought. Debugging had to be discovered. I can remember the exact instant when I realized that a large part of my life from then on was going to be spent in finding mistakes in my own programs."
--Maurice Wilkes
 
Alright I now have the mySQL DB up and running. I have uninstalled both DBD and DBI and I'm sitting in PPM..
[tt]
ppm> search dbi*
Searching in Active Repositories
1. DBI [1.35] Database independent interface for Perl
2. DBI [1.37] Database independent interface for Perl
...
[/tt]
My error was complaining that I didn't have 1.14 but my only options are these two. My gut says to just install 1.37 but I think that is what was causing me headaches in the first place.

Any suggestions?
 
Sorry, I should probably mention I am using ActiveState Perl and their repository.
 
I think that the error message
[tt]DBI object version 1.37 does not match $DBI::VERSION 1.14 at C:/Perl/lib/DynaLoader.pm line 249.[/tt]
means that your server has (somehow) managed to get bits of two different versions intermixed. The main module, DBI.pm, is declaring it's own version to be 1.14 and then, when it tries to dynamically load extra bits, it finds that they are from a different version.

Attempting to deinstall the current version is probably wise but I don't think which version you then choose is important.

Good luck,


fish



"As soon as we started programming, we found to our surprise that it wasn't as easy to get programs right as we had thought. Debugging had to be discovered. I can remember the exact instant when I realized that a large part of my life from then on was going to be spent in finding mistakes in my own programs."
--Maurice Wilkes
 
The reason [tt]DBI object version 1.37 does not match $DBI::VERSION 1.14[/tt] was because someone had copied 1.14 into place. For some reason the force option did not overwrite the old files. And the uninstall was not removing the DBI files.

The end result was that no matter how many times I reinstalled the old files were not being removed.

Finally I realized what was happening and[ol]
[li]Uninstalled Perl[/li]
[li]Manually deleted any folders that remotely looked like they were associated with perl.[/li]
[li]Reinstalled Perl[/li]
[li]ppm installed DBI[/li]
[/ol]
Everything is working happily.

Thanks for help.


 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top