php mssql怎么连接呀?

xingdanyang 2015-05-25 04:36:58
我该下载的也下载了,该设置的也设置了
最后出现了:Warning: odbc_connect() [function.odbc-connect]: SQL error: [Microsoft][ODBC 驱动程序管理器] 未发现数据源名称并且未指定默认驱动程序, SQL state IM002 in SQLConnect

求大神们帮忙解决
...全文
2140 22 打赏 收藏 转发到动态 举报
写回复
用AI写文章
22 条回复
切换为时间正序
请发表友善的回复…
发表回复
IamnotProgrammer 2015-06-26
  • 打赏
  • 举报
回复
楼主真的很牛
IamnotProgrammer 2015-06-26
  • 打赏
  • 举报
回复
还不错哦,的确是有用的
qq_28802675 2015-06-06
  • 打赏
  • 举报
回复
这也太难解决了吧。
baidu_28768241 2015-06-05
  • 打赏
  • 举报
回复
qq_28744961 2015-06-05
  • 打赏
  • 举报
回复
我也不知道什么内容
LiuSmallkilo 2015-06-05
  • 打赏
  • 举报
回复
我记得是有的地址的,
qq_28771083 2015-06-05
  • 打赏
  • 举报
回复
私丨唸 2015-06-04
  • 打赏
  • 举报
回复
。。。。这种问题也在论坛问,那么多实例的
sinat_28751139 2015-06-04
  • 打赏
  • 举报
回复
学习学习额
霍尔鹦鹉 2015-06-04
  • 打赏
  • 举报
回复
qq_28740883 2015-06-04
  • 打赏
  • 举报
回复
学习经验 ,不懂的太多啊
gt1008612580 2015-06-03
  • 打赏
  • 举报
回复
范例 Example #1 DSN-less connections <?php // Microsoft SQL Server using the SQL Native Client 10.0 ODBC Driver - allows connection to SQL 7, 2000, 2005 and 2008 $connection = odbc_connect("Driver={SQL Server Native Client 10.0};Server=$server;Database=$database;", $user, $password); // Microsoft Access $connection = odbc_connect("Driver={Microsoft Access Driver (*.mdb)};Dbq=$mdbFilename", $user, $password); // Microsoft Excel $excelFile = realpath('C:/ExcelData.xls'); $excelDir = dirname($excelFile); $connection = odbc_connect("Driver={Microsoft Excel Driver (*.xls)};DriverId=790;Dbq=$excelFile;DefaultDir=$excelDir" , '', ''); ?> 参见 For persistent connections: odbc_pconnect() - Open a persistent database connection
gt1008612580 2015-06-03
  • 打赏
  • 举报
回复
PHP odbc_connect Connect to a datasource odbc_connect (PHP 4, PHP 5) odbc_connect — Connect to a datasource 说明 resource odbc_connect ( string $dsn , string $user , string $password [, int $cursor_type ] ) The connection id returned by this functions is needed by other ODBC functions. You can have multiple connections open at once as long as they either use different db or different credentials. With some ODBC drivers, executing a complex stored procedure may fail with an error similar to: "Cannot open a cursor on a stored procedure that has anything other than a single select statement in it". Using SQL_CUR_USE_ODBC may avoid that error. Also, some drivers don't support the optional row_number parameter in odbc_fetch_row(). SQL_CUR_USE_ODBC might help in that case, too. 参数 dsn The database source name for the connection. Alternatively, a DSN-less connection string can be used. user The username. password The password. cursor_type This sets the type of cursor to be used for this connection. This parameter is not normally needed, but can be useful for working around problems with some ODBC drivers. The following constants are defined for cursortype: SQL_CUR_USE_IF_NEEDED SQL_CUR_USE_ODBC SQL_CUR_USE_DRIVER 返回值 Returns an ODBC connection id or 0 (FALSE) on error.
qq_28719095 2015-06-03
  • 打赏
  • 举报
回复
我也不知道啊1234113654撒的发生的范德萨发几克拉上的风景
gt1008612580 2015-06-03
  • 打赏
  • 举报
回复
找到PHP.ini文件中 mssql.dll相关内容 解开前面的注释

547

社区成员

发帖
与我相关
我的任务
社区描述
Cloud Foundry是业界第一个开源PaaS云平台,它支持多种框架、语言、运行时环境、云平台及应用服务,使开发人员能够在几秒钟内进行应用程序的部署和扩展,无需担心任何基础架构的问题。
社区管理员
  • Cloud Foundry社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧