|
站内google搜索postgresql什么内容也没有,搜索sql倒是很多结果
,用连接mysql的方法连接postgresql总是提示失败
$db_user="iii"
$db_password="000"
$db_name="nswcf_co"
$db_host="192.168.13.43"
Func _MySQLConnect($sUsername, $sPassword, $sDatabase, $sServer, $sDriver = "{MySQL ODBC 5.1 Driver}", $iPort=5432)
Local $v = StringMid($sDriver, 2, StringLen($sDriver) - 2)
Local $key = "HKEY_LOCAL_MACHINE\SOFTWARE\ODBC\ODBCINST.INI\ODBC Drivers", $val = RegRead($key,$v)
If @error or $val = "" Then
SetError(2)
Return 0
EndIf
$ObjConn = ObjCreate("ADODB.Connection")
$Objconn.open ("DRIVER="&$sDriver&";SERVER="&$sServer&";DATABASE="&$sDatabase&";UID="&$sUsername&";PWD="&$sPassword&";PORT="&$iPort)
If @error Then
SetError(1)
Return 0
Else
Return $ObjConn
EndIf
EndFunc ;==>_MySQLConnect
$sql = _MySQLConnect($db_user,$db_password,$db_name,$db_host)
If @Error = 2 Then MsgBox(0, "Error", "请安装 MySQL ODBC Driver!")
If @Error = 1 Then MsgBox(0, "Error", "连接数据库失败!")
怎么查看postgresql呢? |
|