主题:[讨论]请大家帮忙啊
代码如下:
Dim conn,rs
Set conn=CreateObject("ADODB.Connection")
conn.open"provider=SQLOLEDB.1;Data Source=192.168.1.100;"& _
"user ID=sa;Password=310012;"& _
"inital Catalog=ZYWMM5_Single"
Set rs=CreateObject("ADODB.RecordSet")
sql="Select * from sc_dict_Station"
rs.Open sql,conn,1,3
rs.MoveFirst
While Not rs.EOF
For i=0 To rs.Fields.Count-1
str=str & " " & rs.Fields(i).Value
Next
str=str & vbCrLf
rs.MoveNext
Wend
WScript.Echo str
rs.Close
Set rs=Nothing
conn.Close
Set conn=Nothing
我想通过vbs查询192.168.1.100上的SQL Server 2000数据库上ZYWMM5_Single表中的所有数据,如果用vbsedit运行的话,提示对象名ZYWMM5_Single无效...这是为什么啊?哪位大侠可以帮帮忙啊?
说明:192.168.1.100上已经安装了SQL Server 2000数据库,而且sa用户的密码也没有错,表ZYWMM5_Single也存在...
Dim conn,rs
Set conn=CreateObject("ADODB.Connection")
conn.open"provider=SQLOLEDB.1;Data Source=192.168.1.100;"& _
"user ID=sa;Password=310012;"& _
"inital Catalog=ZYWMM5_Single"
Set rs=CreateObject("ADODB.RecordSet")
sql="Select * from sc_dict_Station"
rs.Open sql,conn,1,3
rs.MoveFirst
While Not rs.EOF
For i=0 To rs.Fields.Count-1
str=str & " " & rs.Fields(i).Value
Next
str=str & vbCrLf
rs.MoveNext
Wend
WScript.Echo str
rs.Close
Set rs=Nothing
conn.Close
Set conn=Nothing
我想通过vbs查询192.168.1.100上的SQL Server 2000数据库上ZYWMM5_Single表中的所有数据,如果用vbsedit运行的话,提示对象名ZYWMM5_Single无效...这是为什么啊?哪位大侠可以帮帮忙啊?
说明:192.168.1.100上已经安装了SQL Server 2000数据库,而且sa用户的密码也没有错,表ZYWMM5_Single也存在...