How do I connect to a MSSQL database using Perl#39;s DBI module in Windows?(如何在 Windows 中使用 Perl 的 DBI 模块连接到 MSSQL 数据库?)
问题描述
如何在 Windows 中使用 Perl 的 DBI 模块连接到 MSSQL 数据库?
How do I connect to a MSSQL database using Perl's DBI module in Windows?
推荐答案
使用 DBD::ODBC.如果您只是使用控制面板 -> 系统管理 -> ODBC 数据源 -> 系统数据源或用户数据源创建数据源(这些是我记得的名称,但我的 XP 不是英文的,所以我无法检查),那么您所要做的就是在 DBI 连接字符串中使用该数据源的名称.
Use DBD::ODBC. If you just create a data source with the Control Panel -> System Management -> ODBC Data Sources -> System Data Source or User Data Source (those are the names as I remember them, but my XP isn't in English, so I can't check), then all you have to do is use the name of that data source in the DBI connect string.
my $dbh = DBI->connect("dbi:ODBC:$dsn", $user, $pwd, \%attr);
用户和系统数据源之间的区别在于后者可供任何用户使用.
The difference between User and System data source is that the latter is usable by any user.
另见:如何:在 Windows XP 中创建系统数据源名称
这篇关于如何在 Windows 中使用 Perl 的 DBI 模块连接到 MSSQL 数据库?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!
本文标题为:如何在 Windows 中使用 Perl 的 DBI 模块连接到 MSSQL 数据库?
基础教程推荐
- mysql选择动态行值作为列名,另一列作为值 2021-01-01
- 如何在 SQL 中将 Float 转换为 Varchar 2021-01-01
- MySQL 中的类型:BigInt(20) 与 Int(20) 2021-01-01
- 二进制文件到 SQL 数据库 Apache Camel 2021-01-01
- oracle区分大小写的原因? 2021-01-01
- 在多列上分布任意行 2021-01-01
- 表 './mysql/proc' 被标记为崩溃,应该修复 2022-01-01
- 在 MySQL 中:如何将表名作为存储过程和/或函数参数传递? 2021-01-01
- 什么是 orradiag_<user>文件夹? 2022-01-01
- 如何根据该 XML 中的值更新 SQL 中的 XML 2021-01-01
