It would also help you, if you include the variable $sql, in the error
message you print out. This makes it very easy to, see if what you
intended be prepared and executed, actualy was.
Simon Oliver wrote:
> I think you will find this is line 71:
>
> $dataObject = $dbh->prepare($sql);
>
> Either way, the error suggests that you don't have a valid handle
> (database or statement).
>
> If it is the former then you didn't make your connection.
> If it is the latter then the prepare failed.
>
> I suggest you connect like with RaiseError so you can see what the
> problem is:
>
> And looking at your script the problem is that you have a malformed DSN:
>
>
> DBI->connect($dbName, $dbUserName, $dbPassword, $dbDriver)
>
> that is "old-style" connect it should be more like this:
>
> DBI->connect("dbi:ODBC:$dbName", $dbUserName, $dbPassword,
> {RaiseError=>1} )
>
> You will probably want to use eval{} or 'use CGI::Carp
> qw(fatalsToBrowser);' to trap any errors.
>
> Finally, it is really bad idea to execute unchecked sql statements from
> a browser!
>
> --
> Simon Oliver
> _______________________________________________
> Perl-Win32-Web mailing list
> [EMAIL PROTECTED]
> http://listserv.ActiveState.com/mailman/listinfo/perl-win32-web
>
--
Chuck Tellechea
Living is easy with eyes closed,
misunderstanding all you see...
--John Lennon
_______________________________________________
Perl-Win32-Web mailing list
[EMAIL PROTECTED]
http://listserv.ActiveState.com/mailman/listinfo/perl-win32-web