Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
First perl/ODBC connection
Message
From
09/08/2001 20:07:51
 
 
To
All
General information
Forum:
Microsoft SQL Server
Category:
SQL syntax
Title:
First perl/ODBC connection
Miscellaneous
Thread ID:
00542084
Message ID:
00542084
Views:
52
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?
Next
Reply
Map
View

Click here to load this message in the networking platform