Version 3.0.2.2R (Unofficial)
Unofficial Changes Works with Native Clients 11/10/9
There are different versions of the Native Client components for each SQL Server.
SQL Server 2005 - Native Client 9.0
SQL Server 2008 - Native Client 10.0
SQL Server 2012 - Native Client 11.0
SELECT
SERVERPROPERTY('servername') AS 实例名,
SERVERPROPERTY('ProductVersion') AS 实例版本,
SERVERPROPERTY('Edition') AS 产品版本,
SERVERPROPERTY('ProductLevel') AS 版本级别,
@@VERSION AS 版本信息
Public Const scUserAgent = "Microsoft Internet Explorer 6.0"
Public Const INTERNET_FLAG_RELOAD = &H80000000
Public Declare Function InternetOpen Lib "wininet.dll" Alias "InternetOpenA" (ByVal sAgent As String, ByVal lAccessType As Long, ByVal sProxyName As String, ByVal sProxyBypass As String, ByVal lFlags As Long) As Long
Public Declare Function InternetOpenUrl Lib "wininet.dll" Alias "InternetOpenUrlA" (ByVal hOpen As Long, ByVal sUrl As String, ByVal sHeaders As String, ByVal lLength As Long, ByVal lFlags As Long, ByVal lContext As Long) As Long
Public Declare Function InternetReadFile Lib "wininet.dll" (ByVal hFile As Long, ByVal sBuffer As String, ByVal lNumBytesToRead As Long, lNumberOfBytesRead As Long) As Integer
Public Declare Function InternetCloseHandle Lib "wininet.dll" (ByVal hInet As Long) As Integer
Public Function GetUrlStr(URL) As String '调用时 URL 参数一定要带 http:// 前缀.
$sql="select CB001 主件品号,CB005 元件品号,CB021 位号 from {$ZT}.dbo.BOMCB where CB001 = '{$PNO}'";
//$sql="select t1.CB005 元件,t2.MB004 替代料,t2.MB002 主件品号,t1.CB021 位号 from DGSC.dbo.BOMCB t1,DGSC.dbo.BOMMB t2
//where t1.CB005=t2.MB001 and t1.CB001 = '8HC011CMM80' and t2.MB002 in ('8HC011CMM80','********************')";
$rs = $this->app->db->Execute($sql);
if($rs){
if(!$rs->EOF){
$this->app->saveLog("{$ZT}找到{$PNO}!");
$data["bom"]=$rs->GetRows();
//
$sql="select t1.CB005 元件,t2.MB004 替代料,t2.MB002 主件品号,t1.CB021 位号 from {$ZT}.dbo.BOMCB t1,{$ZT}.dbo.BOMMB t2 where t1.CB005=t2.MB001 and t1.CB001 = '{$PNO}' and t2.MB002 in ('{$PNO}')";
$rss = $this->app->db->Execute($sql);
$data["replace"]=$rss->GetRows();
//
$sql="select t1.CB005 元件,t2.MB004 替代料,t2.MB002 主件品号,t1.CB021 位号 from {$ZT}.dbo.BOMCB t1,{$ZT}.dbo.BOMMB t2 where t1.CB005=t2.MB001 and t1.CB001 = '{$PNO}' and t2.MB002 in ('********************')";
$sql="insert into smt.c_bom_replace(BOM_CODE,CUST_KP_NO,REPLACE_NO,LOCATION,DOWNLOADTIME,EMP) values ('{$PNO}','{$kp}','{$rkp}','{$loc}',now(),'SYANT')";
$sql="insert into smt.c_bom_replace(BOM_CODE,CUST_KP_NO,REPLACE_NO,LOCATION,DOWNLOADTIME,EMP) values ('{$md5}','{$kp}','{$rkp}','{$loc}',now(),'SYANT')";