baagrid and ODBC to Access

Questions about the MySQL, PostgreSQL, and most other databases, as well as using it with PHP can be asked here.

Moderator: General Moderators

Post Reply
jmacrae@lamina.co.uk
Forum Newbie
Posts: 1
Joined: Wed Oct 29, 2003 6:07 am

baagrid and ODBC to Access

Post 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
User avatar
Johnm
Forum Contributor
Posts: 344
Joined: Mon May 13, 2002 12:05 pm
Location: Michigan, USA
Contact:

Post 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
Last edited by Johnm on Mon Nov 03, 2003 9:55 am, edited 1 time in total.
User avatar
JAM
DevNet Resident
Posts: 2101
Joined: Fri Aug 08, 2003 6:53 pm
Location: Sweden
Contact:

Re: baagrid and ODBC to Access

Post 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.
Post Reply