How is this script being run? CGI? PerlIS? PerlEx?

Can you try it without Unicode::String?

1. It probably doesn't matter in this case, but you should "use strict" at the 
beginning of the script.  It will help a lot with debugging later.
2. "my $db, $query;" isn't doing what you think it is doing.  The variable names 
should  be enclosed in parenthesis.  "use warnings" would have notified you of this 
problem.
3. Don't take for granted that all function calls are successful.  Be sure to check 
the return codes.

Peter Guzis
Web Administrator, Sr.
ENCAD, Inc.
- A Kodak Company
email: [EMAIL PROTECTED]
www.encad.com 

-----Original Message-----
From: William Limratana [mailto:[EMAIL PROTECTED]
Sent: Thursday, October 23, 2003 9:01 AM
To: [EMAIL PROTECTED]
Subject: ADO returning junk and crashing IIS


Hello, 

  I am having some problems retrieving data from a database.  When 
retrieving data, I often get garbled information following what I've 
retrieved.  I think it's memory corruption of some kind.  dllhost.exe 
often crashes after 4-5 calls to the page containing the code (at the end 
of this email).

This only seems to be happening on one of my machines.  I'm using Windows 
2000 and the latest mdac, if that should matter.  I use other programs, 
running on this machine and others, which interact with the MS SQL Server 
database on this machine with no problems.

Thank you,
  William


---------------------------------------
begin code
---------------------------------------

use Unicode::String qw(utf8 utf16);
use Win32::OLE qw/CP_UTF8/;
Win32::OLE->Option(CP => CP_UTF8);

my $db, $query;

$query = "Select Test from Unicode_Test";

$Conn = Win32::OLE->new("ADODB.Connection");
$RS   = Win32::OLE->new("ADODB.Recordset");

$DSN = "Provider=sqloledb;Data Source=mymachine;Initial 
Catalog=database;User Id=sa;Password=sa";


$Conn->Open($DSN);

$RS->Open($query, $Conn, 1, 1);

until ($RS->EOF) {
        $Response->Write($RS->Fields("Test")->value);
        $Response->Write("<BR>");

   $RS->MoveNext;}

$RS->Close;
$Conn->Close;


_______________________________________________
Perl-Win32-Users mailing list
[EMAIL PROTECTED]
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs

_______________________________________________
Perl-Win32-Users mailing list
[EMAIL PROTECTED]
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs

Reply via email to