Hello,

1. What is code compatibility pourcent ASP IIS ( microsoft) vs APACHE::ASP ?

2.Are you exemple apache::asp code example to connect to mysql ?


Thks !

William



----- Original Message -----
From: "Josh Chamas" <[EMAIL PROTECTED]>
To: "Farshid Dabesh-Khoy" <[EMAIL PROTECTED]>
Cc: <[EMAIL PROTECTED]>
Sent: Monday, March 31, 2003 10:39 PM
Subject: Re: FW: ASP db connection


> Farshid Dabesh-Khoy wrote:
> > Josh,
> >
> > Thank you very much for your reply.
> >
> > What you are saying makes sense although it is a completely new concept
> > to me. Just to give you a bit more information with regards to the
> > system I'm working with:
> >
> > I'm running Apache 2.0.36 on SPARC Solaris 2.8
> > I am trying to connect to an ORACLE database and I am using the
> > Apache_ASP module to run the ASP pages. I also of course have all the
> > necessary bits and pieces to allow me to connect to the databases
> > through Perl.
> >
>
> You will have to rewrite this into perl scripted DBI.  Here's an example
> of how to do this for this section, as the ADODB and DBI syntaxes are
> not even similar...
>
> dim oRS
> dim strcustomer
> dim strinst
> dim stronebill
> set oRS = server.createobject("ADODB.Recordset")
> sqlText = "select dc.customer_name, do.onebill_account,
da.installation_name,count(da.id) as countid"
> sqlTEXT = sqlTEXT & " from ds_customer dc, ds_onebill do, ds_account da"
> SqlTEXT = sqlTEXT & " where dc.customer_number=do.customer_number"
> SqlTEXT = sqlTEXT & " and do.onebill_account = da.onebill_account"
> SqlTEXT = sqlTEXT & " and do.bill_profile='NoaTrial'"
> SqlTEXT = sqlTEXT & " group by dc.customer_name,
do.onebill_account,da.installation_name"
> SqlTEXT = sqlTEXT & " order by dc.customer_name;"
>
> 'Response.write sqlTEXT
> oRS.OPEN sqlTEXT, "DSN=noah; UID=noah; PWD=XXXX"
>
> --------- convert to PERL equivalent -----------
>
> # put in global.asa for global database handle
> use Apache::DBI;
> use DBI;
> use vars qw($dbh);
> sub Script_OnStart { $dbh = DBI->connect(...); }
>
> # then in script
> <%
> my $sth = $dbh->prepare(<<SQL);
>   select dc.customer_name, do.onebill_account,
da.installation_name,count(da.id) as countid
>   from ds_customer dc, ds_onebill do, ds_account da
>   where dc.customer_number=do.customer_number
>   and do.onebill_account = da.onebill_account
>   and do.bill_profile='NoaTrial'
>   group by dc.customer_name, do.onebill_account,da.installation_name
>   order by dc.customer_name
> SQL
>   ;
> $sth->execute
>
> while(my $data = $sth->fetchrow_hashref) {
>    my $customer_name = $data->{CUSTOMER_NAME};
>    %>
>      ...
>    <%
> }
> $sth->finish;
> %>
>
> Regards,
>
> Josh
> ________________________________________________________________
> Josh Chamas, Founder                   phone:925-552-0128
> Chamas Enterprises Inc.                http://www.chamas.com
> NodeWorks Link Checking                http://www.nodeworks.com
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>
>



---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to