Results 1 to 4 of 4

Thread: How to link access database with VB 6.0 in VB projects.

  1. #1
    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?

  2. #2
    Join Date
    May 2009
    Posts
    539

    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")

  3. #3
    Join Date
    May 2009
    Posts
    527

    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”

  4. #4
    Join Date
    May 2009
    Posts
    637

    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

Similar Threads

  1. Replies: 3
    Last Post: 11-12-2010, 11:45 PM
  2. Open and print Access Database without access?
    By Boagrius in forum Software Development
    Replies: 6
    Last Post: 28-08-2010, 11:28 PM
  3. Creating Database link in database
    By Lachlann in forum Software Development
    Replies: 3
    Last Post: 28-01-2010, 01:17 PM
  4. Link two tables Using MS Access
    By jean-paul martell in forum Windows Software
    Replies: 3
    Last Post: 03-10-2009, 10:14 AM
  5. convert filemaker pro database to access database
    By Czack in forum MS Office Support
    Replies: 3
    Last Post: 15-04-2007, 01:06 AM

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Page generated in 1,713,894,301.82102 seconds with 17 queries