Jump to content

[SOLVED] odbc_close / killing sesion between db and web server


Recommended Posts

hey again, 3 posts in 1 day  ;)

 

Warning: odbc_exec() [function.odbc-exec]: SQL error: [Microsoft][ODBC Microsoft Access Driver] ODBC--connection to 'rc_cc800_ccm' failed., SQL state S1000 in SQLExecDirect in C:\CCURE800\wgui\v1\test.php on line 58

 

Firstly, I understand what is happening to a point. The connection to the database is exceeding and telling php to bugger off and leave it alone. Thus, if i restart apache, the error myteriously disaperes for another 500 odd queries to take place.

 

obvious? close the conenction maybe,

 

odbc_close($link);

 

and also tried

 

odbc_close_all();

 

but the error still persists...is tehre another way of closing/killing the link between database and webserver?

 

System DSN: ccure_php (odbc connection to Microsoft Access File MDB, no username/password required)

$link = odbc_connect('ccure_php', '','');

$sql = "SELECT * FROM TABLES";

$row = odbc_exec($link, $sql);

if(odbc_num_rows($row)){
	while ($r = odbc_fetch_array($row))
	{
		$personID = $r['PERSONID'];
		$firstName = $r['FIRSTNAME'];
		$lastName = $r['LASTNAME'];
		$cardNum = $r['CARDNUM'];
		$doorName = $r['Door_Name'];
		$dateTime = $r['Local_DT'];
		$temptime = DateAdd('s',$dateTime,'01/01/1990 00:00:00');
		$temptime = DateAdd('y', 20, $temptime);
		echo "$personID $firstName $lastName $cardNum $doorName " .strftime('%H:%M:%S %A %d %b',$temptime). "<br>";
	}
}


//here are a few things (that i jnow of - to close the connection down)

odbc_close($link);
odbc_close_all();

 

link 58:

$row = odbc_exec($link, $sql);

 

i dont think its credential related because it returns results and if i restart apache the error goes away.

 

isn't this the correct process:

 

connect

query

exec connection/query

get results

close connection

?

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.