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.

Perl

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");
$DB->FetchRow();
($f1, $f2) = $DB->Data("f1", "f2");
print "f1 = ". $f1;
$DB->Close();

VBScript

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
 
objRecordSet.MoveFirst
Wscript.Echo objRecordSet.RecordCount

Python

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 192.168.201.1 is your WAN gateway)

route add 0.0.0.0 mask 0.0.0.0 192.168.201.1

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 10.100.0.0 mask 255.255.0.0 10.100.0.1

Useful links:

http://www.microsoft.com/resources/documentation/windows/xp/all/proddocs/en-us/route.mspx?mfr=true