[prev in list] [next in list] [prev in thread] [next in thread]
List: perl-win32-users
Subject: Problems connection to ODBC-DSN (was: Re: ssh and Term::ReadKey on
From: Alexander Apprich <a.apprich () science-computing ! de>
Date: 2004-08-27 5:56:24
Message-ID: 412ECD08.5070400 () science-computing ! de
[Download RAW message or body]
[Attachment #2 (multipart/signed)]
[Attachment #4 (multipart/mixed)]
Rohit,
first of all, please do not hijack a thread. For other it's hard
to follow and you probably won't get the help you need.
Rohit Nagpal wrote:
> Hi Alexander,
> I have been using win32::ODBC , after downloading and installing ODBC.pm
> from perl site. But when I test to connect to sql server from .pl
file and
> run it in browser, it gives as error
> "[Microsoft][ODBC SQL Server Driver][SQL Server]Login failed for user
> 'EOWYN2\IUSR_EOWYN'." EOWYN2 is my PC name...Do you have any idea
what could
> be the reason.
>
Hmmm, have you tried your script in a command shell? Have you ever
successfully connect to you Database using perl? Login failed could
be a missing password?! I'm not really into ODBC-Perl programming,
so I can just provide a "best guess".
An excellent source are the books of Dave Roth, he is also the author
of Win32::ODBC and he has a FAQ about ODBC on his website
http://www.roth.net/odbc/odbcfaq.htm
Attached is a example script from "Win32 Perl Programming: The Standard
Extensions, Second Edition "by Dave Roth. Chapter 7 example 7.22 to be
exact. If I read this script correct, you start it from cmd like this
C:\>perl Example07_22.pl Your_DSN-Name
> I am attaching .pl file too.
>
> -Rohit
>
Hth
Alex
[snipped original post}
["Example07_22.pl" (text/x-perl)]
# Example 7.22: Using the GetConnectOptions() and SetConnectOptions() methods
# ----------------------------------------
# From "Win32 Perl Programming: The Standard Extensions Second Edition" by Dave Roth
# Published by Macmillan Technical Publishing.
# ISBN # 1-57870-216-X
print "From the book 'Win32 Perl Programming: The Standard Extensions, Second \
Edition'\nby Dave Roth\n\n";
use Win32::ODBC;
my $DSN = shift @ARGV || "MyDSN";
my $db = new Win32::ODBC( $DSN ) || die "Error: " . Win32::ODBC::Error();
my $TraceFile = "C:\\TEMP\\TRACE.SQL";
if($db->GetConnectOption( $db->SQL_OPT_TRACE ) == $db->SQL_OPT_TRACE_OFF )
{
$db->SetConnectOption( $db->SQL_OPT_TRACEFILE, $TraceFile );
$db->SetConnectOption( $db->SQL_OPT_TRACE, $db->SQL_OPT_TRACE_ON );
print "ODBC tracing is now active.\n";
}
else
{
$TraceFile = $db->GetConnectOption( $db->SQL_OPT_TRACEFILE );
print "Tracing is already active.\n";
}
print "The ODBC tracefile is '$TraceFile'.\n";
# ...continue with your code...
$db->Close();
["smime.p7s" (application/x-pkcs7-signature)]
_______________________________________________
Perl-Win32-Users mailing list
Perl-Win32-Users@listserv.ActiveState.com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic