Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > Visual Basic > VB 6 Visual Basic 6 > Pro VB 6
Password Reminder
| FAQ | Members List | Search | Today's Posts | Mark Forums Read
Pro VB 6 For advanced Visual Basic coders working in version 6 (not .NET). Beginning-level questions will be redirected to other forums, including Beginning VB 6.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Pro VB 6 section of the Wrox Programmer to Programmer discussions. This is a community of tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old February 13th, 2006, 06:23 AM
Registered User
Join Date: Feb 2006
Location: Beyrouth, , .
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default Open mde or mdb access file from vb6

hi everybody, im new in programming i wish you can help me in my problem:
I have an access application (.mde, and .mdb), and i need to lunch(open) this application from another application in vb6.
can you help me please..its urgent
if you can please show me the details of the solution step by step
thank you

Reply With Quote
  #2 (permalink)  
Old February 20th, 2006, 01:39 AM
Authorized User
Join Date: Feb 2004
Location: , , Denmark.
Posts: 44
Thanks: 0
Thanked 0 Times in 0 Posts

    Here is an example on how I open an mdb from VB6. In this case
    the DB and the application are placed in the same directory.

    Dim cn As ADODB.Connection
    Dim rs As ADODB.Recordset
    Dim DbPath As String, Mysql As String

    ' Find path to database
    If Right$(App.Path, 1) = "\" Then
        DbPath = App.Path & "excelentDB.mdb"
        DbPath = App.Path & "\excelentDB.mdb"
    End If

    ' connect to database

    Set cn = New ADODB.Connection
    cn.Open "Provider=Microsoft.Jet.OLEDB.4.0; " & _
            "Data Source=" & DbPath

    ' open a recordset

    Set rs = New ADODB.Recordset
    Mysql = "SELECT * From Tabel1"

    Set rs = cn.Execute(Mysql)

    ' do what you have to do

    Set rs = Nothing
    Set cn = Nothing

Hope this can help you-

Reply With Quote

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
How to create database (.mdb) file in vb6 code mrleokarthik Pro VB 6 13 August 7th, 2009 11:39 AM
re-link tables in a .mde when .mdb does not exist poyserr Access 1 February 22nd, 2007 12:49 PM
Passwrd protected mdb file from Crystl Rpt in vb6 Kaustav Pro VB Databases 1 October 24th, 2005 08:08 PM
Using VB6 SP2 to Open Access 2003 .mdb DWSTERRETT VB Databases Basics 1 June 13th, 2005 08:24 AM
Beginning C# Databases - Can;t open .MDB file saxitalis All Other Wrox Books 0 November 6th, 2003 03:56 PM

All times are GMT -4. The time now is 08:13 PM.

Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.