我用ASSECC数据库中做了一个报表,我在VB中用菜单编辑器做了一个菜单,怎么连接ASSECC数据库中的报表?

liyouya 2003-08-21 08:49:38
谢谢!
...全文
26 3 打赏 收藏 转发到动态 举报
写回复
用AI写文章
3 条回复
切换为时间正序
请发表友善的回复…
发表回复
strongfisher 2003-08-21
  • 打赏
  • 举报
回复

Set MSAccess = New Access.Application

MSAccess.OpenCurrentDatabase (App.Path & "\你的数据库")



MSAccess.DoCmd.OpenReport "你的报表", acViewNormal

MSAccess.CloseCurrentDatabase

Set MSAccess = Nothing
strongfisher 2003-08-21
  • 打赏
  • 举报
回复
Dim fld As FieldObject
Dim strCnn As String

' Open the data connection
' Set cnn1 = New ADODB.Connection
' strCnn = "Provider=MSDASQL;Persist Security Info=False;Data Source=Xtreme Sample Database;Mode=Read"
' cnn1.Open strCnn

' Create a new instance of an ADO command object
Set datcmd1 = New ADODB.Command
Set datcmd1.ActiveConnection = cnnCMMS
datcmd1.CommandText = "Customer"
datcmd1.CommandType = adCmdTable

' Add the datasource to the report
m_RePort.Database.AddADOCommand cnnCMMS, datcmd1
' Add a new field object to the report and set the field object to use
' the new data source.
Set fld = m_RePort.Section3.AddFieldObject("{ado.Customer Name}", 0, 0)
liyouya 2003-08-21
  • 打赏
  • 举报
回复
:to strongfisher(haiwolf)
你好,我按照你说去做的时候,点击运行时,系统说编译无效,用户定义类型未定义!
请详细的告诉我,好吗?拜托,多谢!

1,216

社区成员

发帖
与我相关
我的任务
社区描述
VB 数据库(包含打印,安装,报表)
社区管理员
  • 数据库(包含打印,安装,报表)社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧