Narayana, Sriman Export License Required - US UTCHQ wrote:
Hi,
I am new to perl programming. Installed mysql,perl,mysql odbc drivers
in my machine. Following is my code, its not working. I googled it but
no use :(
I have not used MySQL on Windows myself but the normal way to access
MySQL from Perl is using DBD::mysql - perhaps that is not available for
Windows. If you need to use ODBC then there are two DBI drivers to
choose from DBD::ODBC and DBD::W32ODBC. I've never used DBD:W32ODBC but
then I've not used Perl and ODBC on Windows much.
use DBI::W32ODBC;
$dbh= DBI->connect("DBI:W32ODBC:TestMyDSN","rootuser","rootuserpwd") ||
die "Got error $DBI::errstr when connecting to $dsn\n";
error msg:
Error connecting to DBI:W32ODBC:TestMyDSN;UID=rootuser;PWD=rootuserpwd:
[911] []
"[Microsoft][ODBC Driver Manager] Data source name not found and no
default dri
ver specified"
Got error when connecting to
This has not even reached your ODBC driver. The driver manager cannot
find DSN TestMyDSN.
is there any thing missing in my machine? Any idea?
> Thanks in advance.
>
> Thanks & Regards,
> Sri
>
Have you created a DSN called TestMyDSN in the ODBC Administrator in
Control Panel? If you have, is it a user DSN or a system DSN? User DSNs
are only visible to the user who created them e.g. you log on as Sri,
create a user DSN then attempt to use it under a web server not running
as Sri (that won't work, you'd need a system DSN in that case).
There are also File DSN, but I'm assuming you are not using one of those.
Martin
--
Martin J. Evans
Easysoft Limited
http://www.easysoft.com