logo
Apache Lounge
Webmasters

 


About

Forum Index Downloads Search Register Log in  RSS Apache Lounge
 



Keep Server Online

If you find the Apache Lounge, the downloads and overall help useful, please express your satisfaction with a donation.

or

Bitcoin

A donation makes a contribution towards the costs, the time and effort that's going in this site and building.

Thank You! Steffen

Apache Lounge is not sponsored.

Your donations will help to keep this site alive and well, and continuing building binaries.



Apache with ADODB.Connection

 
Post new topic   Reply to topic    Apache Forum Index -> Coding & Scripting Corner



View previous topic :: View next topic  
Author Message
alex84



Joined: 10 May 2011
Posts: 1

PostPosted: Tue 10 May '11 18:38    Post subject: Apache with ADODB.Connection Reply with quote

HI, I'm Alex from Rome.
I'm writing to you for a problem.

I have a Perl script for OLE DB Connection. This script connects to PIOLEDB server for access to database. Only for receiving data. The connection code is the following:


# Create a connection object
our $conn = Win32::OLE->new('ADODB.Connection');
die error() if error();

# set the provider for the connection
$conn->{Provider} = "PIOLEDB";

# open the connection. This is where all but the provider should go.
# sometimes, the provider can go in this string instead of above.
# this is the area where the connection string goes.

$conn->Open("Data Source=x.x.x.x;PWD=;UID=admin");
die error() if error();

It work well, running on command line.

I need to insert this script on apache http server, for accessing with URL
(f.i. http://localhost/TestAdoDB.cgi).

The same script run on web doesn't work...
The error log file say this:

Win32::OLE(0.1709) error 0x8007007e: "The specified module could not be found"

refer at our $conn = Win32::OLE->new('ADODB.Connection');.

How can I run script for OLE DB connection on apache??
Do I must add particular .dll, files, set registry permissions ??
I tried to use :

$conn = Win32::OLE->new(['localhost',ADODB.Connection']);but I have "class not register" error.

The environment is the following:

Virtual Machine with Windows Server 2008 64bit
Apache http Server x86
ActivePerl x86
PIOLEDB x86 and 64bit.

Thanks in advance Smile
Back to top
James Blond
Moderator


Joined: 19 Jan 2006
Posts: 6225
Location: Germany, Next to Hamburg

PostPosted: Thu 14 Jul '11 21:03    Post subject: Reply with quote

is that perl or PHP code?
Back to top
vm505



Joined: 20 May 2014
Posts: 2
Location: Aachen, De

PostPosted: Tue 20 May '14 14:06    Post subject: Reply with quote

If you have a combination of windows x64, apache and a win32 cgi (exe) using ADODB you have the problem that the enviroment variable CommonProgramFiles(x86)is translated into CommonProgramFiles_x86_

Adodb needs that env-variable to find the software, so it ends there.


The problem lies in util_script.c (2.4.9)

AP_DECLARE(char **) ap_create_environment(apr_pool_t *p, apr_table_t *t)
{
...
while (*whack != '=') {
if (!apr_isalnum(*whack)) {
*whack = '_';
}
++whack;
}
...
}


I propose a Change into :

while (*whack != '=') {
if (!apr_isalnum(*whack) && *whack != '(' && *whack != ')') {
*whack = '_';
}
++whack;
}


You also need the following in Httpd.conf:

SetEnv ProgramFiles "C:\Program Files"
SetEnv "ProgramFiles(x86)" "C:\Program Files (x86)"
SetEnv ProgramFilesW6432 "C:\Program Files"
SetEnv CommonProgramFiles "C:\Program Files\Common Files"
SetEnv "CommonProgramFiles(x86)" "C:\Program Files (x86)\Common Files"
SetEnv CommonProgramFilesW6432 "C:\Program Files\Common Files"

I tested the proposal with httpd 2.2 and httpd 2.4.9. Works fine.

Send me a message if you need the mod_cgi.so file

cheers

John
Back to top
frhack



Joined: 08 Aug 2015
Posts: 1
Location: Italy

PostPosted: Sat 08 Aug '15 14:39    Post subject: Reply with quote

vm505 wrote:

Send me a message if you need the mod_cgi.so file

cheers

John


Hi i need mod_cgi.so can you send me?

thanks!!!
Back to top
glsmith
Moderator


Joined: 16 Oct 2007
Posts: 2121
Location: Sun Diego, USA

PostPosted: Sat 08 Aug '15 21:14    Post subject: Reply with quote

Since it has been more than a year, no answer from the OP doesn't surprise me.

Per your email to dev@httpd you stated this which might be helpful to know here as well;

Server version: Apache/2.2.22 (Win32)
Server built: Jan 28 2012 11:16:39

The timestamp tells me this is from apache.org so it is built with VC6 (yes, this matters). Now anyone who might wish to do this knows all the needed info.
Back to top


Post new topic   Reply to topic    Apache Forum Index -> Coding & Scripting Corner
Page 1 of 1