Information générale
Forum:
Microsoft SQL Server
Titre:
First perl/ODBC connection
I am trying to figure out how to connect to MSSQL server 7.0 database using perl/odbc thus far I have set up odbc connection that tests successfully but when connecting via perl script i get error message.
The Code used:
#!/perl/bin/perl
&print_header;
&connect_db;
sub print_header{
print "Content-type: text/html\n\n";
}
sub connect_db{
$DSN="GameServer";
use Win32::ODBC;
if (!($db=new Win32::ODBC($DSN ))) {
print "
Error connecting to $DSN\n";
print "Error: " . Win32::ODBC::Error() . "\n";
}
else {
print "Connection Successful";
}
}
The ERROR Msg:
Error connecting to GameServer Error: [18452] [] "[Microsoft][ODBC SQL Server Driver][SQL Server]Login failed for user '(null)'. Reason: Not associated with a trusted SQL Server connection."
How do i use the 'sa' username and pass along in scripts to allow access to the database?
Suivant
Répondre
Voir le fil de ce thread
Voir le fil de ce thread à partir de ce message seulement
Voir tous les messages de ce thread
Voir tous les messages de ce thread à partir de ce message seulement