RE: Win32::GetLastError() [was: Win32:OLE - Speech.VoiceText]

2005-06-14 Thread Jan Dubois
As well as looking at $!, you might also try looking at Win32::FormatMessage(Win32::GetLastError()), as that often gives much a better indication of the problem where windows processes are involved. (You have to 'use Win32;' to do that.) You can use $^E instead of Win32::GetLastError(). It

Re: Win32:OLE - Speech.VoiceText

2005-06-14 Thread $Bill Luebkert
Jon Bjornstad wrote: This code: use Win32::Ole; my $voice = Win32::Ole-new(Speech.VoiceText); $voice-Register('', 'Perl'); $voice-speak(hello world); STDIN;# wait til it finishes speaking has been used succesfully on Windows98 (with the Microsoft Speech SDK installed) and on

Re: Win32:OLE - Speech.VoiceText

2005-06-14 Thread Octavian Rasnita
Oh great! It works this way. Teddy - Original Message - From: Jan Dubois [EMAIL PROTECTED] To: 'Sisyphus' [EMAIL PROTECTED]; perl-win32-users@listserv.ActiveState.com; 'Jon Bjornstad' [EMAIL PROTECTED] Sent: Tuesday, June 14, 2005 5:19 AM Subject: RE: Win32:OLE - Speech.VoiceText On

Re: Win32:OLE - Speech.VoiceText

2005-06-14 Thread Octavian Rasnita
I have also tried the following script under Windows 2000 but it doesn't work and it doesn't give any error. The SAPI 4 is installed by default in Windows 2000 and it works fine with Narrator and with my screen reader so this is not a problem. Under Windows XP SAPI 5 is installed by default, and

Use DBI; vs. use Win32::ODBC;

2005-06-14 Thread Ted Yu
I recently wanted to use the following code for a select statement: use DBI;my $dbh = DBI-connect( "dbi:ODBC:{database}","{username}", "{password}") or error('CONNECT_SQL'); my $results = $dbh-selectall_arrayref('select count(*) from tblTicketFileProcessLog'); print $results;use DBI;my $dbh =

Re: Win32:OLE - Speech.VoiceText

2005-06-14 Thread Jon Bjornstad
Octavian - The script below still has the error that I originally introduced. It should be $voice-Speak(hello world, 0); Thanks to Jan for the research! So now I can code like this: use Win32; my $speech_object = (Win32::GetOSName() =~ /XP/)? SAPI.SpVoice: Speech.VoiceText; use

Re: Use DBI; vs. use Win32::ODBC;

2005-06-14 Thread Sisyphus
- Original Message - From: Ted Yu [EMAIL PROTECTED] [snip] I keep getting an error that reads: Can't locate DBI.pm in @INC... Can't really help with main part of your request, but I can tell you that error means that the DBI module is not installed on your machine - or if it is

RE: Use DBI; vs. use Win32::ODBC;

2005-06-14 Thread Bullock, Howard A.
Did you install the DBI module? I have found that if you need to run your program for an extended period of time and need to reconnect to your DB, Win32::ODBC has a memory leak that can cause you problems. Howard A. Bullock Computer Security Tyco Electronics 717-810-3584

RE: Use DBI; vs. use Win32::ODBC;

2005-06-14 Thread Peter Eisengrein
What would be the code if i used Win32:ODBC? The result of the select statement is a single value and not an array. Appreciate your help, as I am new to using remote connections to a SQL database with Perl. I have used itin a while loop and performed thousands of

Array length reading problem

2005-06-14 Thread Apurva Shukla
Hi All, I read some data from an xml file into a hash. Now the hash can be $VAR1 = { 'XYZ' = [ { 'NAME' = 'N1' }, { 'NAME' = 'N2' } ], }; OR Even $VAR1 = { 'XYZ' = { 'NAME' = 'N1' } }; Meaning XYZ can be an 'Array of hashes' or a 'Single Hash' Now if I want to traverse all

RE: Array length reading problem

2005-06-14 Thread Joe Discenza
Apurva Shukla wrote, on Tue 6/14/2005 09:28 :XYZ can be an 'Array of hashes' or a 'Single Hash':: Now if I want to traverse all that is contained in XYZ I first read the array length :and then traverse it one by one.:: How can I get a length of an array and in case its not an array I can

RE: Use DBI; vs. use Win32::ODBC;

2005-06-14 Thread Ted Yu
I tried to print out the output of the select statement. No error, but no printout either. Not sure if there is an error in my code: use Win32::ODBC; my $pw = "password1";my $user = "ted";my $dsn = "db1";$db = new Win32::ODBC("DSN=$dsn;UID=$user;PWD=$pw") || die "ERROR: Failed to open database

RE: Use DBI; vs. use Win32::ODBC;

2005-06-14 Thread Peter Eisengrein
My bad. Either declare @data outside the if block or else process the array within the block. By having the 'my' inside it is localized and therefore you get no response. -Original Message-From: Ted Yu [mailto:[EMAIL PROTECTED]Sent: Tuesday, June 14, 2005 1:54 PMTo: