Kind of a general post, using pervasive as the example database:
I'm using Win2k, IIS5, pervasive.sql, php4 w/ odbc built in.
My first problem was getting php working with my virtual directory.
Next I wanted to use a DSN to connect to a pervasive db that I had created. All it would do is hang.
Next I tried to connect to an access db and I got errors.
So I knew it had something to do with the web server. IIS5 runs as the un-privledged user IUSR_WIN2K, but both of my databases where expecting an administrative user.
When I changed IIS to run as administrator, both odbc connections worked great. But this is a giant security hole.
So I created the user 'bob'.
Here's how I did it:
Go into pervasive control center and look at the properties of the db in question.
Go to the Security tab and establish a password for managing security for this database.
This will set the password for the 'Master' user of THIS database, enter it twice and click APPLY.
Then click OK and go into USERS, right click and click New User. Enter a username and password and set the appropriate permissions if you have pre-existing tables.
The next time that you go into pervasive control center and try to work with tables, you'll be prompted for a username and password. If you gave this new user create table privledge, all of the tables could be built under this user.
bob has a table called 'names' with fields 'first' and 'last'.
Make sure you have a DSN for this pervasive database. ( I called mine test5 )
Here's my test script:
<?
// connect to a DSN "test5" with username
// and password
$connect=odbc_connect('test5','bob','xxx');
// query the 'names' table
$query = "SELECT * FROM names";
// perform the query
$result = odbc_exec($connect, $query);
// fetch the data from the database
while(odbc_fetch_row($result)){
$first = odbc_result($result, 1);
print "$first<br>\n";
}
// close the connection
odbc_close($connect);
?>
I haven't tried Access yet, but I suspect that if you set up security on the database, in a similiar fashion to what I have done, you'll be able to query it in no time.