激活“浏览"功能功能并浏览要使用的数据库. [英] activate a "browse" function and browse the database to be used.

查看:65
本文介绍了激活“浏览"功能功能并浏览要使用的数据库.的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

伙计们,

我的编码有问题.
我打算用按钮进行浏览".
我希望浏览"按钮通过驱动器创建浏览功能,以便能够选择要用于我的应用程序的数据库.

例如.我的C盘中有2个数据库. (C:/database/db1.mdb& C:/database/db2.mdb)

我有一个按钮(btnBrowse)和一个OpenFileDialog.

我有此编码,但我被卡住了:

Good day guys,

I''m having problem with my codings.
I intend to do a "browse" with a button.
I want the "browse" button to create a browse function through my drive to be able to choose the database that I want to use for my application.

E.g. i have 2 database in my C drive. (C:/database/db1.mdb & C:/database/db2.mdb)

I''m having a button(btnBrowse) and a OpenFileDialog.

I have this coding but I''m stuck :

Private Sub btnBrowse_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
       Using ofd As New OpenFileDialog
           ofd.Filter = "All files (*.*)|*.*"
           ofd.Title = "Select File"

           If ofd.ShowDialog() = Windows.Forms.DialogResult.OK Then
               MessageBox.Show("You selected " & ofd.FileName)
           End If
       End Using

   End Sub



有什么想法可以继续吗?

谢谢:D



Any ideas how can i continue?

Thanks :D

推荐答案

真是个奇怪的问题.您如何看待您应该如何进行?如何使用浏览到的路径构建连接字符串?
What a bizarre question. How do you THINK you should proceed ? How about building a connection string using the path you browsed to ?


这篇关于激活“浏览"功能功能并浏览要使用的数据库.的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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