|
Function CustAddress_Count(custcode)
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对象
End Function
连接数据库提示“[Microsoft][ODBC 驱动程序管理器]未发现数据源名称并且未指定默认驱动程序”,请问哪里写错了?
[ 本帖最后由 linwenyan 于 2008-6-20 12:05 编辑 ] |
|