任何人都可以帮助我如何将参数放入odbc_connect()
使用 php 连接另一台服务器上的数据库 *.mdb 驱动程序。
$conn=odbc_connect('','','');
谢谢。
You can put the mdb file on a share on the server and access it that way but there are limitations doing that. You can get yourself an ODBC-ODBC Bridge and that allows connection to any remote ODBC data source so long as you can install something on the server.
<?php
// Microsoft SQL Server utilise le pilote SQL Native Client 10.0 ODBC Driver :
// il permet les connexions à SQL 7, 2000, 2005 et 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" , '', '');
?>`