Page 1 of 1

baagrid and ODBC to Access

Posted: Wed Oct 29, 2003 6:07 am
by jmacrae@lamina.co.uk
Hi there, I'm having a little truoble trying to use baagrid (looks great!) with ODBC.

I'm relatively new to PHP but receive the following error:

[Microsoft][ODBC Microsoft Access Driver]Invalid use of null pointer

when running the code.

Here's the code:

Code: Select all

global $querystring, $grid, $dsn, $xdsn, $ires;

$dsn = "TLSHOME";
$xdsn = odbc_connect($dsn, "", "" );

include ('baaGrid.php');

$queryString = "SELECT * FROM PROP_INF"; 

$grid = new baaGrid ($querystring, DB_ODBC, $xdsn);

$grid->showErrors(); // just in case

$grid->display();
Any clues received would be very welcome.

J

Posted: Mon Nov 03, 2003 8:08 am
by Johnm
You may have better luck with OLEDB as I did. Here is a sample dbconnect that I use. I tend to keep it in it's own file and just include it when I need it.

Code: Select all

<?php

 $conn = new COM("ADODB.Connection") or die("Cannot start ADO");
    $conn->Open("Provider=Microsoft.Jet.OLEDB.4.0;Data Source=D:\Inetpub\wwwroot\mis\dir\dbname.mdb; User ID=Admin; Password=");
?>

John M

Re: baagrid and ODBC to Access

Posted: Mon Nov 03, 2003 9:51 am
by JAM
jmacrae@lamina.co.uk wrote:[Microsoft][ODBC Microsoft Access Driver]Invalid use of null pointer
I recall that this is a bug (in ODBC I think). I tried to look it up to see if there was a way to work around it, but I came up empty. I'd try OLEDB also.