- 论坛徽章:
- 1
|
执行一个perl脚本 (pear.conf是配置文件 记载了数据库连接的参数)结果提示- DBI connect('server=S10;charset=cp936','sa',...) failed: Server message number=4002 severity=14 state=1 line=0 server=ase1254lnx64 text=Login failed.
- OpenClient message: LAYER = (0) ORIGIN = (0) SEVERITY = (78) NUMBER = (34)
- Server S10, database
- Message String: Adaptive Server connection failed
- at ./ying.pl line 1112
复制代码 ===============
因为程序apple.pl 里面引用了程序“ying.pl ”- # 函数文件引用声明
- my $strPath = &dirname($0);
- my($strBaseName,$strDirName) = &fileparse($0);
- require $strDirName . ‘ying.pl’ ;
复制代码 --呵呵 有点复杂吧
看到错误信息 我就定位到了 文件ying.pl 的第1112行 位置附近- if ( $DbType =~ /sybase/i ) {
- print "连接 sybase 数据库 $host : $dbname ... \n";
- if ( $dbh = DBI->connect("DBI:Sybase:server=$host;charset=$charset",$username,$passwd) ) {
- print "连接 sybase 数据库 $host 成功! \n";
- if ( $dbname ne '' ) {
- if ( $dbh->do("use $dbname") ) {
- print "转换为数据库 $dbname 成功! \n";
- } else {
- print "Couldn't Select Database : $dbname \n";
- $dbh = undef;
- }
- }
- } else {
复制代码 --唉 按提示说 应该是数据库连接不上
但是脱离这个程序 我使用配置文件里同样的参数去连接数据库 是连得上的!!
现在我实在想不出可能的原因会出在哪里?大家能看出想出可能存在的原因吗??
都不知道应该从哪个方向下手了》。
数据库连接的 服务名,用户名,密码都没错啊 ,为什么会连接失败呢 郁闷了!! |
|