前天做了一个小程序,供在深圳的同事使用从数据库中取数
conn.ConnectionString = "Provider=SQLOLEDB.1;Password=1233211234567 ;Persist Security
Info=True;User ID=administrator ;Data Source=rgbufserver"
conn.Open
Set rst = New ADODB.Recordset
With rst
.ActiveConnection = conn
.CursorLocation = adUseServer
.CursorType = adOpenForwardOnly
.LockType = adLockReadOnly
.Open "select ccccode 部门,ccuscode 客户编号,ccusname 客户名称,ccode 科目,sum(md) 借方
,sum(mc) 贷方 FROM (ufdata_004_2004.dbo.GL_accvouch inner join ufdata_004_2004.dbo.customer
on ccus_id=ccuscode) WHERE iflag is null and ccode like '1131%' and dbill_date
between '" & Ds & "' and '" & De & "' group by ccccode,ccuscode,ccusname,ccode"
运行到此出错,提示如下:
系统管理员 administrator 为何没有权限打开一个数据库呢?
如何用安全类sql语句 将 administrator设为有效用户 并将 ufdata_004_2004的select 权限赋于 administrator 呢?(因为数据库是在异地,而程序使用人不懂得操作sql server数据库,故有此要求)
谢谢
[此贴子已经被作者于2004-3-9 20:12:54编辑过] |