You can use the below function which will return Now press OK twice, and we have our DSN! Establish Connection with PHPįor this we are going to use PDO to establish the connection, as MySQLi will not allow us to open a connection via the odbc driver. Double click “DOCUMENTS” and select your database. Please note that the “Database Name” search will be *.mdb, which you’ll need to change to *.accdb if you didn’t save your file as an MDB file. Next, we’ll select our database which was saved to our documents file earlier. Now we will name our DSN “testdb” which we will use later in our PHP code. From here we want to open a Microsoft Access (*.mdb) file. MySQL), then you will need to instead run the 32bit version of ODBC Data Source Administrator, this can be located within:īefore opening please ensure the current 64bit version is closed, then click Add… again. If you are greeted with only one option (E.G. In order to add a DSN, you should select ‘Add…’, which should list many of the below. For full fledged DSNs I’d recommend System DSNs on a server. The tab that is open by default (User DSN) will allow you to create DSNs only visible and usable by the current users logged into the machine, which will suit our current needs for a development database. This will open a window allowing you to create your own DSN. On Windows, go to your control panel, select Administrative Tools > Data Sources (ODBC). A data source name (DSN) is a data structure that contains information about the database file we have created, which is accessed by an Open Database Connectivity (ODBC) driver.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |