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 |
How do you use bcrypt for hashing passwords in php?
How can you encrypt password using php?
Explain Constant in Class?
What is the difference between explode() and split() functions?
Which function can be used to exit from the script after displaying the error message?
What is sticky form in php?
hi recently i had faced an interview in that they asked me that php have faced the problem of y2k so which one is that year like 2030,2059 not remember exact year anybody will tell me pls?
Which software is best for php?
Is php a web server?
What is mem_cache ? How do you put a database query into that ?
Explain type casting and type juggling.
What is php oop?