$sth=$dbh->prepare("SELECT * FROM users WHERE user LIKE 'sparkie' AND passwd LIKE 'foo' USE master"); #### use DBI(); my $user1 = 'sparkie'; my $user2 = 'c-era'; my $pass1 = 'foo'; my $pass2 = 'bar'; $dbh = DBI->connect("dbi:ODBC:TLRS",'sa','') or die "$DBI::errstr\n"; $sth=$dbh->prepare("SELECT * FROM users WHERE user LIKE ? and passwd LIKE ? USE master"); $sth->execute($user1, $pass1); while($ref = $sth->fetchrow_hashref) { print"$ref->{'user'},$ref->{'passwd'},$ref->{'allow'}\n"; } $sth->execute($user2, $pass2); while($ref = $sth->fetchrow_hashref) { print"$ref->{'user'},$ref->{'passwd'},$ref->{'allow'}\n"; } $sth->finish(); $dbh->disconnect;