我該下載的也下載了,該設定的也設定了
最后出現了:Warning: odbc_connect() [function.odbc-connect]: SQL error: [Microsoft][ODBC 驅動程式管理器] 未發現資料源名稱并且未指定默認驅動程式, SQL state IM002 in SQLConnect
求大神們幫忙解決
uj5u.com熱心網友回復:
PHP odbc_connect Connect to a datasourceodbc_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.
uj5u.com熱心網友回復:
范例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
uj5u.com熱心網友回復:
找到PHP.ini檔案中mssql.dll相關內容 解開前面的注釋
uj5u.com熱心網友回復:
我也不知道啊1234113654撒的發生的范德薩發幾克拉上的風景uj5u.com熱心網友回復:
。。。。這種問題也在論壇問,那么多實體的
uj5u.com熱心網友回復:
學習經驗 ,不懂的太多啊uj5u.com熱心網友回復:
uj5u.com熱心網友回復:
學習學習額
uj5u.com熱心網友回復:
我記得是有的地址的,uj5u.com熱心網友回復:
我也不知道什么內容uj5u.com熱心網友回復:
uj5u.com熱心網友回復:
牛
uj5u.com熱心網友回復:
這也太難解決了吧。uj5u.com熱心網友回復:
還不錯哦,的確是有用的uj5u.com熱心網友回復:
樓主真的很牛轉載請註明出處,本文鏈接:https://www.uj5u.com/qita/92935.html
上一篇:如何讓U盤運行exe
