如何在Access数据库中获取表并比较SQL Server数据库中的表是否存在 [英] How to get tables in Access database and compare that tables is there or not in sql server database

查看:85
本文介绍了如何在Access数据库中获取表并比较SQL Server数据库中的表是否存在的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在Windows应用程序中,我正在通过浏览器访问该数据库前端的MSAccess数据库,我将在我想要在SQL Server中比较该表之后在该数据库中选择该表的时间.桌子是不是?

Hi I am doing windows application in this i am accessing MSAccess database this database front end through browse i will select that database that time i want to get tables in this database after getting that tables i want to compare in my sql server this tables is their or not? how to do this task?

推荐答案

Hello OP,

我了解您的需求,并且还分析了您在研发方面没有做任何事情.但是不要紧.
因此,让我们从这一点开始,而不是期望我们这边的代码片段.我想做下面的任务,因为如果我有同样的需求,我会做同样的事情.

1)创建一个桌面应用程序,并放置一个文本框,一个列表框,一个按钮
2)在按钮的click事件上,使用以下步骤编写代码
a)连接访问数据库(如何连接访问数据库通过C# )
b)列出访问数据库中的所有表并将它们存储到一个数据表中.(如何通过C#连接SQL SERVER 2005实例 [ ^ ] )
d)循环考虑数据表并检查此查询是否存在,然后在sql中找到表,否则将表名添加到列表框中
Hello OP ,

I understand what you need and also analyzed that you have done nothing with respect to research and development from your side. but never mind.
So lets start with this , rather than expecting code snippet from our side . I would like to do below task as I would have doing the same thing if I will be in the same need.

1) Create one desktop application and place one text box, one list box , one button
2) on the click event of button write the code by using below step
a) connect access database (How to connect access database through C# )
b) List all tables from access database and store them into one data table.( How to list all tables from access database[^])
c) Connect sql server 2005 instance . (How to connect SQL SERVER 2005 Instance through C#[^])
d) Loop thought datatable and check for this query if exist then table is there in sql other wise add that table name into listbox
SELECT * FROM Sysobjects WHERE xtype='u' AND Name=tablename



希望这会有所帮助,并认为我涵盖了所有要点和链接.如果是,那么投票并证明这是答案.
我欢迎您的询问和关注.
--RDBurmon高级软件工程师.



Hope this helps and think I covered all the points and link . If yes then vote and certify this as answer .
I will welcome your queries and concern .
--RDBurmon Sr.Software Engineer.


这篇关于如何在Access数据库中获取表并比较SQL Server数据库中的表是否存在的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆