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 17-11-2010
Member
 
Join Date: Nov 2010
Posts: 51
How to link access database with VB 6.0 in VB projects.

Hey,I have created an Access database in MS Office as back end, and I'd like to be able to write a VB 6.0 as a front-end in my VB 6.0 projects. Does anybody know if you can use VB 6.0 to link to an access database or any other database that can i connect in VB 6.0, and if so, do you know of any step-by-step examples that original like myself could use to learn how to do it? Can you help me out?
Reply With Quote
  #2  
Old 17-11-2010
Member
 
Join Date: May 2009
Posts: 532
Re: How to link access database with VB 6.0 in VB projects.

Since you are using an access database
Try to use "Microsoft OLE DB Provider for Access" (in the Data Link Properties),
then "Next>>" command button, and in "Enter a server name" you should have somewhat like " Microsoft.Jet. 4.0 OLEDB " (your Access server name) and you also use User name and password, if required. Just to connect your DataEnvironment to your access database. In code in VB 6, to connect to your Access database, you should have a connection string something like:
Code;
option explicit
Dim con as ADODB.Connection
con.Open ("Provider=Microsoft.Jet. 4.0 OLEDB;Data Source=C:\Program Files\VB projects \School\school.mdb;Persist Security Info=False")
Reply With Quote
  #3  
Old 17-11-2010
Member
 
Join Date: May 2009
Posts: 523
Re: How to link access database with VB 6.0 in VB projects.

Suppose you are using an SQL Server database
Try to use "Microsoft SQLOLE DB Provider for SQL Server" (in the Data Link Properties), then "Next>>" command button, and in "Enter a server name" you should have to some extent like " Microsoft. SQLOLEDB " (your SQL Server server name) and you also use Username and password, if essential.
In code in VB 6, to connect to your SQL Server DB, you should have a connection string, the code as follow:
Option explicit
Dim sql1 as string
Dim con as ADODB.Connection
Set con = new ADODB.connection
Con.ConncetingString = Sql1
Con.CursorLocation = adUseNone

Sql1 = ?Provider = Microsoft.SQLOLEDB; Data Source= C:\ Program Files\ My Projectc\ College\ College.mdb; Persist Security Info = False?
Reply With Quote
  #4  
Old 17-11-2010
Member
 
Join Date: May 2009
Posts: 620
Re: How to link access database with VB 6.0 in VB projects.

Suppose you are using any database server to connect with VB 6.0.
Try to use "Microsoft DB Provider for database server" (in the Data Link Properties), then "Next>>" command button, and in "Enter a server name" you should have to some extent like "Microsoft. OLEDB " (your desire server name), In code in VB 6, to connect to your DB, you should have a connection string, the code as follow is shown below:
Option explicit
Dim con as ADODB.Connection
Set con = new ADODB.connection
Con.open “Provider = Microsoft.OLEDB; Data Source= App.path\ College.mdb; Persist Security Info = False”
Con.CursorLocation = adUseNone
Reply With Quote
Reply

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



Thread Tools Search this Thread
Search this Thread:

Advanced Search


Similar Threads for: "How to link access database with VB 6.0 in VB projects."
Thread Thread Starter Forum Replies Last Post
Access 2010 file in Access 2007 gives Unrecognized Database Format Roakman MS Office Support 3 11-12-2010 11:45 PM
Open and print Access Database without access? Boagrius Software Development 6 28-08-2010 11:28 PM
Creating Database link in database Lachlann Software Development 3 28-01-2010 01:17 PM
Link two tables Using MS Access jean-paul martell Windows Software 3 03-10-2009 10:14 AM
convert filemaker pro database to access database Czack MS Office Support 3 15-04-2007 01:06 AM


All times are GMT +5.5. The time now is 09:36 PM.