stevebravo
Gebruiker
- Lid geworden
- 16 jan 2010
- Berichten
- 156
De volgende stappen heb ik ondernomen om een access connectie te krijgen:
1: Open the Administrative Tools icon in your Control Panel.
Double-click on the Data Sources (ODBC) icon inside.
Choose the System DSN tab.
Click on Add in the System DSN tab.
Select the Microsoft Access Driver. Click Finish.
In the next screen, click Select to locate the database.
Give the database a Data Source Name (DSN).
Click OK.
2: een database gemaakt
3: de volgende php code ingevoerd:
vervolgens krijg ik deze foutmelding:
Warning: odbc_connect() [function.odbc-connect]: SQL error: [Microsoft][ODBC Microsoft Access Driver] Cannot open database '(unknown)'. It may not be a database that your application recognizes, or the file may be corrupt., SQL state S1000 in SQLConnect in C:\xampp\htdocs\Website\test.php on line 3
Notice: Use of undefined constant conn - assumed 'conn' in C:\xampp\htdocs\Website\test.php on line 5
boe2
Warning: odbc_close() expects parameter 1 to be resource, boolean given in C:\xampp\htdocs\Website\test.php on line 14
waarom?
1: Open the Administrative Tools icon in your Control Panel.
Double-click on the Data Sources (ODBC) icon inside.
Choose the System DSN tab.
Click on Add in the System DSN tab.
Select the Microsoft Access Driver. Click Finish.
In the next screen, click Select to locate the database.
Give the database a Data Source Name (DSN).
Click OK.
2: een database gemaakt
3: de volgende php code ingevoerd:
PHP:
<?php
/**
* Maak connectie met de database door de volgende code te gebruiken
**/
$dsn = 'database.accdb';
$username = '';
$password = 'wachtwoord';
$connectie = odbc_connect($dsn, $username, $password);
if($connectie) {
echo 'Er is connectie met de dsn';
} else {
echo 'Geen connectie';
}
odbc_close($connectie);
?>
vervolgens krijg ik deze foutmelding:
Warning: odbc_connect() [function.odbc-connect]: SQL error: [Microsoft][ODBC Microsoft Access Driver] Cannot open database '(unknown)'. It may not be a database that your application recognizes, or the file may be corrupt., SQL state S1000 in SQLConnect in C:\xampp\htdocs\Website\test.php on line 3
Notice: Use of undefined constant conn - assumed 'conn' in C:\xampp\htdocs\Website\test.php on line 5
boe2
Warning: odbc_close() expects parameter 1 to be resource, boolean given in C:\xampp\htdocs\Website\test.php on line 14
waarom?
Laatst bewerkt: