Home > Archive > PERL Beginners > September 2007 > How to connect MS Access with ODBC
You are viewing an archived Text-only version of the thread.
To view this thread in it's original format and/or if you want to reply to
this thread please [click here]
| Author |
How to connect MS Access with ODBC
|
|
| Herostar1981 2007-09-19, 4:01 am |
| Hi all,
I am meeting a big problem.
I try to use Perl to connect MS Access database from a remote
machine .
But I can not find a good way.
I want use the DSN-less way.
I search it from google, and get this example:
use DBI;
$dbh = DBI->connect('dbi:ODBC:driver=Microsoft Access Driver
(*.mdb);dbq=f:\db1.mdb');
My question is how to setup the host name or port number?
Like this:
$dbh = DBI->connect('dbi:ODBC:driver=Microsoft Access Driver
(*.mdb);ServerPort:128.128.110.110;dbq=f:\db1.mdb');
, right?
or replace ServerPort with HOST?
All of them do not work.
And if I make the "dbq" value as a .mdb file from local machine.
It queries records from the local file without connect remote machine.
I am tired about this. Maybe I can try make DSN, but I am afraid it
can not connect a remote machine.
Does anybody have a solution?
Help me!
Best Regards,
Xu
| |
| useperl-jeff@yahoo.com.cn 2007-09-19, 8:00 am |
|
--- herostar1981 <huanxiang.xu@gmail.com> wrote:
> Hi all,
> I am meeting a big problem.
> I try to use Perl to connect MS Access database from a remote
> machine .
> But I can not find a good way.
> I want use the DSN-less way.
> I search it from google, and get this example:
> use DBI;
> $dbh = DBI->connect('dbi:ODBC:driver=Microsoft Access Driver
> (*.mdb);dbq=f:\db1.mdb');
>
> My question is how to setup the host name or port number?
> Like this:
> $dbh = DBI->connect('dbi:ODBC:driver=Microsoft Access Driver
> (*.mdb);ServerPort:128.128.110.110;dbq=f:\db1.mdb');
> , right?
> or replace ServerPort with HOST?
AFAIK,MS Access is a local file-based database,which doesn't have ports
listening.How can you access it from remote host via connecting to its
non-exist port?
You can check the document for DBD::ODBC,
http://search.cpan.org/~mjevans/DBD-ODBC-1.14/ODBC.pm
--
Jeff Pang
________________________________________
________________________________________
____ Feel safe with award winning spam protection on Yahoo!7 Mail.
www.yahoo.com.au/mail
| |
| Herostar1981 2007-09-19, 10:00 pm |
| On Sep 19, 5:45 am, useperl-j...@yahoo.com.cn wrote:
> --- herostar1981 <huanxiang...@gmail.com> wrote:
>
>
> AFAIK,MS Access is a local file-based database,which doesn't have ports
> listening.How can you access it from remote host via connecting to its
> non-exist port?
Are you sure?
But I get these results from Google with typing "connect remote ms
access database" :
http://www.google.com/search?q=conn...lient=firefox-a
> You can check the document for DBD::ODBC,http://search.cpan.org/~mjevans/DBD-ODBC-1.14/ODBC.pm
>
> --
> Jeff Pang
Thank you very very much!
I am expecting your answer!
Best Regards,
Xu
>
> ________________________________________
________________________________________
____ Feel safe with award winning spam protection on Yahoo!7 Mail. www.yahoo.com.au/mail
| |
| Herostar1981 2007-09-19, 10:00 pm |
| On Sep 19, 5:45 am, useperl-j...@yahoo.com.cn wrote:
> --- herostar1981 <huanxiang...@gmail.com> wrote:
>
>
> AFAIK,MS Access is a local file-based database,which doesn't have ports
> listening.
But I search "connect remote ms access database" from google.
I get these results:
http://www.google.com/search?q=conn...lient=firefox-a
How can you access it from remote host via connecting to its
> non-exist port?
Sorry, can you tell me how to set port for ms access database?
I have no idea about this.
> You can check the document for DBD::ODBC,http://search.cpan.org/~mjevans/DBD-ODBC-1.14/ODBC.pm
>
Thanks a lot.
> --
> Jeff Pang
>
> ________________________________________
________________________________________
____ Feel safe with award winning spam protection on Yahoo!7 Mail. www.yahoo.com.au/mail
| |
| useperl-jeff@yahoo.com.cn 2007-09-19, 10:00 pm |
|
--- herostar1981 <huanxiang.xu@gmail.com> wrote:
> But I search "connect remote ms access database" from google.
> I get these results:
>http://www.google.com/search?q=conn...lient=firefox-a
From the url I got,
strConString = "Provider=MS Remote;" & _
"Remote Server=http://192.168.1.1;" & _
"Remote Provider=Microsoft.Jet.OLEDB.4.0;" & _
"Data Source=MyRemoteDB;Persist Security Info=False"
They connect to remote MS Access with http protocal,and you have to run
IIS on that Access host.
________________________________________
________________________________________
____ Get the World's number 1 free email service.
http://mail.yahoo.com.au
|
|
|
|
|