phpLens
 home  products examples manual  faq support forum  contact news  login store

Forums: phplens   adodb
Forum:   ADOdb Help & Dev
author's name*
email*
topic*
body*
To help us reduce spam, please enter the text in the picture above

You can enter the following UBB tags: [b]bold[/b], [i]italic[/i], [red]red[/red] and [pre] [/pre]

Topic: adodb, mssqlnative, query not returning
author: Siva   created: 30-05-2012 05:10:59 AM
Hello,

I've got a query wherein the select is first stored in a temptable and then again queried from the temp table. All these happens in the query itself, like

select a.field1, a.field2
Into $temptable1
From Table1 a
...

Select field1, sum(field2)
From #temptable1
...

drop table #temptable1

The above query is not returning any records. What should I do to get the result from the above query.

My connection:

$connection = & ADONewConnection('mssqlnative');
$connection->debug = false;
$connection->Connect($databaseServer, $databaseUName, $databasePWord, $databaseName);

$connection->SetFetchMode(ADODB_FETCH_NUM);
$result = $connection->Execute($sql);
if (!$result)
echo $connection->ErrorMsg();

echo $result->RecordCount();

I get no error message and the 0 in RecordCount().

Any help is really appreciated.

Happiness Always
BKR Shivaprakkash
Topic: Re:adodb, mssqlnative, query not returning
author: tony   created: 06-06-2012 02:53:10 AM
Hello,

I have success connection to the server like this
$conn = ADONewConnection($driver);
$conn->connectionInfo = array("UID" => '', "PWD"=>'',"Database"=>'', "ReturnDatesAsStrings"=>true);

if (!$conn->Connect($host,$uid,$pwd,$database)) err($conn->ErrorNo(). $sep . $conn->ErrorMsg());

where host, uid,pwd,database have needed values

Moreover there is a bug in _query function. See my next post.

Regards

Regards

View Source

email: contact#phplens.com (change # to @)     telephone (malaysia): 60-3-7947 2888     fax (malaysia): 60-3-7947 2800