这是我对于report 的setLocation进行修改的代码, 但是总是提示错误信息:
Error Type:
RptControllers.dll (0x8004100F)
Logon failed. Error in File C:\WINNT\TEMP\ {FCF0DCE3-2CE7-4CE8-B880-C22B3E29A0C5}.rpt: Unable to connect: incorrect log on parameters.
希望有知道错误原因地,给个回复。谢谢
For Each crTable In clientDoc.Database.Tables
Set table_new = crTable.Clone
Set pb = table_new.ConnectionInfo.Attributes
pb.Item("Database DLL") = "crdb_ado.dll"
pb.Item("QE_DatabaseName") = strDbName
pb.Item("QE_DatabaseType") = "OLE DB (ADO)"
pb.Item("QE_ServerDescription") = strDbServer
pb.Item("QE_SQLDB") = True
pb.Item("SSO Enabled") = False
pb.Item("QE_LogonProperties").RemoveAll()
pb.Item("QE_LogonProperties").Add "Auto Translate","-1"
pb.Item("QE_LogonProperties").Add "Connect Timeout","15"
pb.Item("QE_LogonProperties").Add "Data Source",strDbServer
pb.Item("QE_LogonProperties").Add "General Timeout","0"
pb.Item("QE_LogonProperties").Add "Initial Catalog",strDbName
pb.Item("QE_LogonProperties").Add "Integrated Security","False"
pb.Item("QE_LogonProperties").Add "Locale Identifier","1033"
pb.Item("QE_LogonProperties").Add "OLE DB Services","-5"
pb.Item("QE_LogonProperties").Add "Provider","SQLOLEDB"
pb.Item("QE_LogonProperties").Add "Tag with columb collation when possible","0"
pb.Item("QE_LogonProperties").Add "Use DSN Default Properties",False
pb.Item("QE_LogonProperties").Add "Use Encryption for Data","0"
table_new.QualifiedName = strDbName & ".dbo." & crTable.Name
table_new.ConnectionInfo.UserName = strDbUser
table_new.ConnectionInfo.Password = strDbPassword
clientDoc.DatabaseController.setTableLocation crTable, table_new
Set table_new = Nothing
Next
------解决方案--------------------
水晶报表啥版本,搞得这么复杂。。
------解决方案--------------------
你连的是什么数据库,sqlserver吗?
------解决方案--------------------
你连的是什么数据库,sqlserver吗
------解决方案--------------------
不能通过ODBC连接?