ConnectionString="driver ={PostgreSQL ANSI};Server=192.168.0.10;UID=1; PWD=1; Database=99;" '初始化连接字符串
Set Conn=CreateObject("ADODB.Connection") '创建Connection对象
Conn.Open ConnectionString ' 调用Open方法,建立连接
If conn.State = 0 Then
Print "连接数据库失败"
Else
Print "连接数据库成功"
End If
Set rs = conn.Execute("select count(custcode) as AddCount from cusaddresstbl where cuscode='" &custcode&"'")
AddressCount = rs("AddCount").Value
Print "AddressCount:"&" "&AddressCount&chr(13)&chr(10)
Conn.Close '关闭连接
Set Conn=Nothing '释放Connection对象