Connect to SQL Server in Perl and in VBScript

Say my database name is Jessica_DB, my user name is jessica, and my password jessica_pwd.


To connect to Microsoft SQL Server using Perl with Win32::ODBC module

use Win32::ODBC;
my $dsn = "DSN=Jessica_DB;UID=jessica;PWD=jessica_pwd;";
my $DB = Win32::ODBC->new($dsn);
$DB->Sql("SELECT f1, f2, f3 FROM MyTable");
($f1, $f2) = $DB->Data("f1", "f2");
print "f1 = ". $f1;


To connect to MS SQL Server using VBScript

Const adOpenStatic = 3
Const adLockOptimistic = 3
Set objConnection = CreateObject("ADODB.Connection")
Set objRecordSet = CreateObject("ADODB.Recordset")
objConnection.Open _
 "Provider=MSDASQL.1;Data Source=Jessica_DB;" & _
 "Trusted_Connection=Yes;" & _
 "User ID=jessica;Password=jessica_pwd;"
objRecordSet.Open "SELECT * FROM MyTable", _
 objConnection, adOpenStatic, adLockOptimistic
Wscript.Echo objRecordSet.RecordCount


To connect in Python, check out pymssql

Connect PC to Cisco Switch or Router

To connect a PC which has two network interfaces (one Ethernet and another wireless) to a LAN, you will want to create a default route to the wireless interface, assuming you are using the wiressless network to get to the Internet (WAN). Here is a link on how to set up a default route on a Windows machine:

Here is the command to add a default route(assume is your WAN gateway)

route add mask

You will also need to add a static route so that all traffic going to LAN are directed to the LAN gateway, instead of to WAN. Here is how:

route add mask

Useful links: