VB.NET 2010 - 跟踪MS Access数据库和链接数据 [英] VB.NET 2010 - Tracking MS Access databases and linking data

查看:96
本文介绍了VB.NET 2010 - 跟踪MS Access数据库和链接数据的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

帮助!



我本身不是程序员,但多年来一直使用VB6 / VBA / Access取得了很大的成功。



试图掌握VB2010 !!!



基本抱怨:我创建了许多带有datagridviews绑定的表单到项目数据源。它们都工作正常,并在开发模式下更新。我还包括检查我的2层访问数据库的代码,并在启动时重新链接表。



但是,似乎没有办法更新用于处理在不同目录中运行的已部署应用程序的项目数据源。



我知道VB.net与VB6相比已经长大,但这肯定是必不可少的部分创建一个应用程序,必须有一个简单的方法来做它...>> ??



真的很棒任何建议,否则我会放弃这个产品,并回到至少可行的坏东西(VB6)。 ;)



Ta,Steve

HELP!

I am not a programmer per se, but have been using VB6 / VBA / Access for many years with plenty of success.

Trying to get to grips with VB2010 !!!

Basic gripe: I created a number of forms with datagridviews bound to a project datasource. They all work fine and update in Development mode. I have also included code to check my 2 tier access database and to re-link the tables on start-up.

However, there seems to be no way to update the project data sources to handle a deployed app running in a different directory.

I know VB.net is grown up compared to VB6, but surely this is an essential part of creating an app, and there must be a straightforward way of doing it..>>??

REALLY GRATEFUL for any suggestions, otherwise I''ll ditch this product, and go back to the bad old stuff (VB6) that at least works. ;)

Ta, Steve

推荐答案

ConnectionString 位于yourprojectname.exe.config文件中。部署应用程序时,可以更改yourprojectname.exe.config文件中的 ConnectionString 以指向实时数据库。
The ConnectionString that points to your database is in the yourprojectname.exe.config file. When you deploy, the application, you can change the ConnectionString in the yourprojectname.exe.config file to point to your "live" database.


可能已经安装了VS2012 Exp,因为我重新下载并安装在另一台PC上,当您更改文件夹时,数据源似乎跟随EXE。只要我刷新任何其他dbs的链接 - 它似乎工作正常!



S
Might have been a duff install of VS2012 Exp, as I re-downloaded and installed on another PC, and the datasource seems to follow the EXE when you change the folder. As long as I then refresh links to any other dbs - it seems to work ok !

S


OK - 注意到,但是我如何(在任一模式下)将App设置为将项目DataSource指向正确的路径?



所持有的数据描述了数据源,以及重新设置它的语法是什么?



我使用App_Path处理本地文件,但不知道如何更改say \ProjectX \ProjectName \\ \\ bin\debug将应用程序数据源指向它实际处于已部署状态的位置。我想我可以在代码中动态创建DataSet(尝试了一下),但各种帖子提示我上面使用的方法更快,所以我很惊讶遇到这么多问题..



如果我必须全部编码,那就这样吧,我明白我会有更多的控制权,但在某些情况下 - 简单就足够了。



S
OK - noted, but how then do I (in either mode) set the App to point the project DataSource to the correct path ?

Where is the information held that decribes the Datasource, and what is the syntax to re-set it??

I use App_Path to handle local files, but have no idea how to change say \ProjectX\ProjectName\bin\debug to point the application datasource to where it actually is in a deployed state. I guess I could create DataSets dynamically in code (tried that a little), but various posts suggested the much quicker method I used above, so I am surprised to run into so many issues..

If I have to code it all, then so be it, and I understand that I would have more control, but in some cases - simple is good enough.

S


这篇关于VB.NET 2010 - 跟踪MS Access数据库和链接数据的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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