| 网站首页 | 业界新闻 | 小组 | 威客 | 人才 | 下载频道 | 博客 | 代码贴 | 在线编程 | 编程论坛
欢迎加入我们,一同切磋技术
用户名:   
 
密 码:  
共有 1408 人关注过本帖
标题:access数据库转成excel数据库如何实现?
只看楼主 加入收藏
guoyuanyihao
Rank: 1
等 级:新手上路
帖 子:3
专家分:0
注 册:2008-7-9
收藏
 问题点数:0 回复次数:0 
access数据库转成excel数据库如何实现?
access数据库转成excel数据库如何实现?
小弟出来乍道,跪求各位大侠帮助。
我链接上了数据库,但是没办法操作excel

Public Class Form1



    Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
        'Dim pWorkspaceFactory As IWorkspaceFactory
        OpenFileDialog.FileName = ""
        OpenFileDialog.Title = "生成数据库"
        OpenFileDialog.Filter = "Access文件 (*.mdb)|*.mdb"
        OpenFileDialog.ShowDialog()
        If OpenFileDialog.FileName <> "" Then
            TextBox1.Text = OpenFileDialog.FileName
        End If
        If Not OpenFileDialog.FileName = "" Then
            'pWorkspaceFactory = New AccessWorkspaceFactory
            'WorkSpace = pWorkspaceFactory.OpenFromFile(TextBox1.Text, 0)
        End If
    End Sub

    Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
        SaveFileDialog.FileName = ""
        SaveFileDialog.Title = "报表保存路径"
        SaveFileDialog.Filter = "Excel 工作簿 (*.xls)|*.xls"
        SaveFileDialog.ShowDialog()
        If SaveFileDialog.FileName <> "" Then
            TextBox2.Text = SaveFileDialog.FileName
        End If
    End Sub

    Private Sub Button4_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button4.Click
        Me.Close()


    End Sub

    Private Sub Button3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button3.Click
        Dim strsql As String
        strsql = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & TextBox1.Text
        Dim Conn As New OleDb.OleDbConnection(strsql)

        Conn.Open()



        Dim Cmd As OleDb.OleDbCommand
        Cmd = New OleDb.OleDbCommand("select * from 123", Conn)
        Dim dr As OleDb.OleDbDataReader
        dr = Cmd.ExecuteReader
        dr.Read()
搜索更多相关主题的帖子: access excel 数据库 
2008-09-27 15:48
快速回复:access数据库转成excel数据库如何实现?
数据加载中...
 
   



关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.057277 second(s), 8 queries.
Copyright©2004-2024, BCCN.NET, All Rights Reserved