use strict; use Win32::OLE; use Win32::OLE::Const; use Win32::OLE::Variant; my $Constname = "Microsoft ActiveX Data Objects 2\\.0 Library"; my $ado_consts = Win32::OLE::Const->Load($Constname); my $database = "somedb"; my $hostname = "somehost"; my $port = "someport"; my $user = "user"; my $password = "pass"; my $conn = Win32::OLE->new("ADODB.Connection"); $conn->{"ConnectionString"} = "Provider=SQLOLEDB.1;User ID=$user;Password=$pass;Initial Catalog=$database;Data Source=$hostname"; $conn->open(); my $recordSet = Win32::OLE->new("ADODB.RecordSet"); my $sql = "select * from table"; $recordSet->{"ActiveConnection"} = $conn; $recordSet->{"CursorLocation"} = 3; $recordSet->{"CursorType"} = 1; $recordSet->{"LockType"} = 3; $recordSet->open($sql); print $recordSet->Supports($ado_consts->{"adBookmark"})."\n"; my $myFilter = "Where Clause without the where"; $recordSer->Filter => $myFilter while (! $recordSet->EOF) { print $recordSet->Fields(0)->value."\n"; $recordSet->MoveNext; } print "\n"; #### Win32::OLE(0.1403) error 0x8002000e: "Invalid number of parameters" in METHOD/PROPERTYGET "Item" at (eval 409)[e:/PROGRA~1/ACTIVE~1//perl5db.pl: 1556] line 2