Is it possible to connect to a Microsoft Access database
without a DSN? If so, how??
Answers were Sorted based on User's Feedback
Answer / binu. v. pillai
Yes, we can
<?php
//Connect access database
$con=odbc_connect("DRIVER={Microsoft Access Driver
(*.mdb)}; DBQ=" . str_replace("/", "\\", $_SERVER
["DOCUMENT_ROOT"]) . "\foldername\dbname.mdb", "db_username"
, "db_password")or die("could'nt connect database");
if (!$con) {
die('Could not connect: ' . odbc_error());
}
?>
| Is This Answer Correct ? | 4 Yes | 1 No |
Answer / ramachandra dixith
ya its working niceley in my local system
still i have to check in server...
any way code is connecting database.
| Is This Answer Correct ? | 0 Yes | 0 No |
Answer / ghan shyam
yes it is posible to connect ms access database without dsn
you have to provide Driver for database and database path in odbc_connect function. like :
odbc_connect(DRIVER={Microsoft Access Driver
(*.mdb)}; DBQ="{database path}", "{db username if any}"
, "{db_password if any}") or die("could not connect to database");
| Is This Answer Correct ? | 0 Yes | 0 No |
what is the use of include() function when include_once() alone will enough?
Whats the difference between include() and require()?
Php program to generate fibonacci series?
What is mvc? Why its been used?
Why many companies are switching their current business language to php? Where php basically used?
Tell me how would you declare a function that receives one parameter name hello?
What are the differences between require and include, include_once?
How is it possible to parse a configuration file?
What is binary safe function in php?
What are objects in php?
Explain different types of errors in PHP (i.e. arguments in errorreporting function)?
8 Answers Base2 Infotech, DCI, Microsoft, Tata Elxsi,
Why laravel is the best php framework in 2019?