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 can you declare the array in php?
Can you specify the "new line" character in single-quoted strings?
What is a session in php?
What is string and its function?
What is php mainly used for?
How to convert a string to uppercase in php?
How we load all classes that placed in different directory in one php file , means how to do auto load classes.
What is php session and how it works?
What is new static in php?
How to find the length of a string?
Does wordpress run on php 7?
What are computer variables?