HOME       >>       Programming

Uploading Access Databases Do they work on Linux Hosting?


I was wondering if Linux Hosting restricts itself to the use of MySQL databses, or if it allows Access databases too.
(Or maybe, Access databases are to be used with .asp pages only, being Microsoft almighty software, don't know).

Anyway, using PHPRunner, I uploaded a set of scripts to use an Access database, I did try it locally (on my system, using EasyPHP), and it worked perfectly.

However,when I uploaded everything and then tested it in my browser, I was greeted with the following:

Fatal error: Call to undefined function odbc_connect() in /home/mrdee/public_html/DBtest/include/dbconnection.php on line 9

Below is the code to the offending file, I changed the value of "$uid" form blank ("") to "root", as, on my system, the username "root is required, and no password is set.
(Doesn't matter disclosing that here, it is only for test purposes.

However, I suspect (could be totally wrong, of course), that my server does not recognise the driver for Access databases and it has trouble with the variable $OCDBString.

Am I right or wrong?
Can an Access database be used on my hosting just like a MySQL database is used?

Who can enlighten me?

Thank you in advance for any advice.

<?phpfunction db_connect(){ global $ODBCString; $uid="root"; $pwd=""; $conn = odbc_connect($ODBCString,$uid,$pwd); if (!$conn) { trigger_error(db_error(), E_USER_ERROR); } return $conn;}function db_close($conn){ return odbc_close($conn);}function db_query($qstring,$conn){ global $strLastSQL,$dDebug; if ($dDebug===true) echo $qstring."<br>"; $strLastSQL=$qstring; if(!($rs=odbc_exec($conn,$qstring))) trigger_error(odbc_error(), E_USER_ERROR); odbc_binmode($rs,ODBC_BINMODE_RETURN); odbc_longreadlen($rs,1024*1024); return $rs; }function db_exec($qstring,$conn){ global $strLastSQL,$dDebug; if ($dDebug===true) echo $qstring."<br>"; $strLastSQL=$qstring; return odbc_exec($conn,$qstring);}function db_pageseek(&$qhandle,$pagesize,$page){ db_dataseek($qhandle,($page-1)*$pagesize);}function db_dataseek(&$qhandle,$row){ $i=0; while($i<$row) { odbc_fetch_row($qhandle); $i++; }}function db_fetch_array(&$qhandle) { return odbc_fetch_array($qhandle);}function db_fetch_numarray(&$qhandle) { $row=array(); odbc_fetch_into($qhandle,$row); return $row;}function db_closequery($qhandle){ @odbc_free_result($qhandle);} function db_error() { return @odbc_errormsg();}function db_numfields(&$lhandle) { return @odbc_num_fields($lhandle);}function db_fieldname(&$lhandle,$fnumber){ return @odbc_field_name($lhandle,$fnumber+1);}?>


Xisto.com offers Free Web Hosting to its Members for their participation in this Community. We moderate all content posted here but we cannot warrant full correctness of all content. While using this site, you agree to have read and accepted our terms of use, cookie and privacy policy. Copyright 2001-2019 by Xisto Corporation. All Rights Reserved.