Go Back   TechArena Community > Software > Software Development
Become a Member!
Forgot your username/password?
Tags Active Topics RSS Search Mark Forums Read

Reply
 
Thread Tools Search this Thread
  #1  
Old 09-12-2009
Member
 
Join Date: Nov 2009
Posts: 60
How can I open a access file in Visual Basics?

Hi All,

I am designing simple Visual Basics projects. In which I need to open a access database in the visual basics. But unfortunately I am not aware about how to open a access file in Visual Basics. For this I have read some VB books,but it doesn't helpful. Please let me know how can I get solution over this problem? I am waiting for your reply.
Reply With Quote
  #2  
Old 09-12-2009
Member
 
Join Date: Feb 2008
Posts: 1,848
Re: How can I open a access file in Visual Basics?

Hi,

I am providing the code which will open the access database file into the Visual Basics, Copy this VB code and use on your system:

Quote:

Dim AccessDemo As New access.application

Dim allMCR As String = "Check"

AccessDemo = CreateObject("Access.Application")

AccessDemo.Visible = True

AccessDemo.OpenAccessProject("d:\path\AccessFileName.mdb")

AccessDemo.DoCmd.RunMacro(allMCR)

End Sub
Reply With Quote
  #3  
Old 09-12-2009
Member
 
Join Date: Jan 2008
Posts: 1,515
Re: How can I open a access file in Visual Basics?

Hi Friend,

I had similar outlook issue with the Html. Surprisingly the problem was in the Internet Explorer. The version of Internet explore which you are using to run Html file may cause error. To overcome this Html issue I recommend you to use Internet Explorer version 6. As Internet Explorer 6 is fully compatible with the interconnection of the Html and Outlook.

For more detailed solution over this issue please visit below link:
http://support.microsoft.com/kb/312542
Reply With Quote
  #4  
Old 09-12-2009
Member
 
Join Date: Apr 2008
Posts: 1,948
Re: How can I open a access file in Visual Basics?

Hi,

There are mainly two ways to include access database in VB. Either you can use Data connection OR ADODB connection. You can use Data connection if you want to use the database which is created within VB. And if you want create the database connection to access database use ADODB connection.

To open the access database using ADODB connection, you will need to provide the connection string. Below is the example of the connection string, in which connection string open the access database which has name "AccessTest.MDB":
Quote:
"Provider=Microsoft.Jet.OLEDB.4.0; Data Source=\\cse1\src\AccessTest.MDB; Mode=Share ; User Id=adminst;Password=;"
Reply With Quote
Reply

  TechArena Community > Software > Software Development
Tags: , , ,



Thread Tools Search this Thread
Search this Thread:

Advanced Search


Similar Threads for: "How can I open a access file in Visual Basics?"
Thread Thread Starter Forum Replies Last Post
How are the file management basics like copy, rename, move and delete in Windows 8? Mr.Aiden Operating Systems 3 23-10-2011 05:17 PM
Problem in Ms Access In Visual Basic Kushan Software Development 3 19-03-2009 02:31 PM
Unable to open project in Visual Studio Harding Windows Software 3 16-02-2009 12:15 PM
Microsoft Access cannot open file on network place PJJB Windows Update 2 06-12-2006 08:18 AM
Java Programming Language Basics: Reflection Basics and Class Class mayuri_gunjan Guides & Tutorials 6 29-08-2005 12:04 AM


All times are GMT +5.5. The time now is 03:04 AM.