connectiing to a secured MS Access DB from VB.NET



  • 1. Simple Binding combo box problem
    Imports System.Data.OleDb Imports System Imports System.Data Imports System.Data.Common Imports System.Windows.Forms Public Class Form1 Inherits System.Windows.Forms.Form I am trying to simple bind a combo box to a data source per the code below in the load procedure. It does not produce any result on the combo box. The code for the text box works fine and the code for the combo box will work if I change the property from SelectedValue to Text. Any suggestions? Dim conStr As String = "Provider=Microsoft.Jet.OLEDB.4.0;data source=c:\\northwind.mdb" Dim conn As New OleDbConnection(conStr) Dim sqlStr As String = "SELECT * FROM Orders" Dim da As New OleDbDataAdapter(sqlStr, conn) Dim ds As New DataSet Dim kwds As New DataSet Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load da.Fill(kwds, "Orders") Dim bmbOrders As BindingManagerBase bmbOrders = Me.BindingContext(kwds, "Orders") TextBox1.DataBindings.Add("Text", kwds, "Orders.CustomerID") ComboBox2.DataBindings.Add("SelectedValue", kwds, "Orders.CustomerID") ComboBox2.ValueMember = "ShipCity" End Sub
  • 2. command button appearance
    I am using xp syyles, generally, but in one instance I would like to show a button with a transparent background and no frame. I've tried setting the flatstyle to flat but the frame remains. Thanks for any help. Bernie Yaeger
  • 3. How do I clear an Image
    In a PictureBox if I want to clear the Image or background do I simply use FromFile("") (just a guess) I did see about FromFile: If the file does not have a valid image format or if GDI+ does not support the pixel format of the file, this method throws an OutOfMemoryException exception. Search all doc and msdn I could find - looks like nobody has need to clear an image! Cal
  • 4. More on Tab Control
    Is it possible to change the color of the text which appears on each tab within a tab control ? Thanks in advance Regards Steve
  • 5. Directory viewer
    Hi, is possible in .net to use a control (like a treeview) to show all folders and subfolders in a specified path? I'm using the browseforfolders control to select the initial path. Thank you in advance Valeria

Re: connectiing to a secured MS Access DB from VB.NET

Postby hirf-spam-me-here » Mon, 19 Apr 2004 20:32:38 GMT

* "Reny J Joseph Thuthikattu" < XXXX@XXXXX.COM > scripsit:

You will more likely get an answer here:

Web interface:

<URL: http://www.**--****.com/ ;

Herfried K. Wagner [MVP]
<URL: http://www.**--****.com/ ;

connectiing to a secured MS Access DB from VB.NET

Postby Reny J Joseph Thuthikattu » Mon, 19 Apr 2004 20:34:28 GMT

When i try to connect to a user name and password protected Access file from
VB.NET i mam getting workgroup information file missiong.
Can any one tell me how to connect to it?

Similar Threads:

1.Shell function - accessing an Access secure db (.MDW file)

Hi - Does anyone know the correct syntax for the shell function.  This is my problem.. my Access db has a workgroup (.MDW) file associated with it and what I am trying to do is run my Access macro, through VB5, that runs a query and exports the results into an Excel spreadsheet.  The following statement does work correctly (but it is accessing an Access db that has NO .MDW file associated with it), I need to incorporate the username and password:
Retval = Shell("c:\Program Files\Microsoft Office\Office\Msaccess.exe " & 
    "c:\salesrpt\grp\roster\marssrs.mdb /x mcrDownloadRosterWeb", 0

Maybe this will help some: (This is a sample of my code, that usually use to access the secure db, note:  the username is MarsSRS and the password is phone1phase

swrkgrpfile = Mid("C:\Salesrpt\Grp\Roster\marssrs.mdb", 1, Len("C:\Salesrpt\Grp\Roster\marssrs.mdb") - 1) + "w
DBEngine.SystemDB = swrkgrpfil
Set wrkConnect = CreateWorkspace("MarsSRS" + CStr(Time), "MarsSRS", 
                   "phone1phase", dbUseJet

Set dbRoster = OpenDatabase("C:\Salesrpt\Grp\Roster\marssrs.mdb"


2.Opening/Linking to (user-level) secured db from unsecured db in VB

I have looked and looked and from what I have seen, there is no way to open 
or link to a (user-level) secured db from an unsecured one usign VBA.  
OpenDatabase seems to have provision to allow a way through database-level 
password protection, but not user-level.
I am writing a db to perform as many steps as I can to convert an MSAccess 
2000 db into an Oracle one with a number of structure changes, so I want to 
open or link (attach) to the tables in the production db, so I can run the 
conversion queries and produce Oracle scripts ready to run on the Unix Oracle 
Any suggestions?

3.Example code to create an MS Access db locally using VB.Net 2003


I am a beginner looking for example code on how to create an access
database for a local application. I need to create the database when
the app is first installed. I can do it with SQL 2000 but I am not
sure how to do create a db, tables and fields as a local mdb. Any help
or pointers to where I can find example code on this much appreciated.


4.Deploying VB .NET application WITH MS Access db

5.Using ".OpenCurrentDatabase" in VB .net to open an MS Access DB

	when I execute the code below I get the usual access message:

SECURITY WARNING----------------------------------

Opening "<filepath & name.mdb>"

The file may not be safe if it contains code that was intended
to harm your computer.
Do you want to cancel the operation?



Private Sub OpenDB(ByVal strMDBFullPath as string)

Dim appDatabase As Access.Application

appDatabase = New Access.Application()
appDatabase.OpenCurrentDatabase(p_strMDBFullPath, True)


End Sub

How can I detect if the user presses the CANCEl button? With the code
above if the user presses the CANCEl button the code throws an exception
on the line "appDatabase.OpenCurrentDatabase(p_strMDBFullPath, True)".

The code is VB .net and the database is 2003 but could be 97, 2000 etc.

Thanks in advance

Paul M.

Return to VB.NET


Who is online

Users browsing this forum: No registered users and 76 guest