Welcome to Dream.In.Code
Getting VB Help is Easy!

Join 118,693 VB Programmers for FREE! Ask your question and get quick answers from experts. There are 1,182 online right now! We've got more than 500 tutorials and 2,000 snippets. Join and find out why Dream.In.Code is the #1 programming help community on the internet! Registration is fast and FREE... Join Now!



connection Access 2007 with vb 6.0

 
Reply to this topicStart new topic

connection Access 2007 with vb 6.0

hraihana
post 6 Aug, 2008 - 01:23 PM
Post #1


New D.I.C Head

*
Joined: 6 Aug, 2008
Posts: 1

CODE

Public Sub openconnection(ByVal sDB)
       Dim Conn1 As New ADODB.Connection                  
        Dim AccessConnect As String

                  
        
        
       AccessConnect = "Driver={Microsoft Access Driver (*.accdb)};" & _
                    "Dbq=sDB;" & _
                    "Uid=Admin;Pwd=;"
                        


      
        Conn1.Open        
End Sub
User is offlineProfile CardPM

Go to the top of the page


dineeshd
post 6 Aug, 2008 - 01:49 PM
Post #2


D.I.C Addict

Group Icon
Joined: 30 Jun, 2008
Posts: 543



Thanked 15 times

Dream Kudos: 575
My Contributions


You have not mentioned what you want. Anyway I am gussing you want to know how to connect to access from vb6.

Establishing connection with DB:
vb

Dim oCon As OleDbConnection = New OleDbConnection
conn1.ConnectionString = "Provider=Microsoft.Jet.Oledb.4.0;Data Source=" & Application.StartupPath & "\YourAccessDatabase.mdb"
oCon.Open()


Still you have doubt with connection string then go to ConnectionStrings.com

This post has been edited by dineeshd: 6 Aug, 2008 - 01:53 PM
User is offlineProfile CardPM

Go to the top of the page

jayman9
post 6 Aug, 2008 - 01:59 PM
Post #3


Student of Life

Group Icon
Joined: 26 Dec, 2005
Posts: 6,473



Thanked 28 times

Dream Kudos: 500

Expert In: C#, VB.NET, Java

My Contributions


@hraihana, code tags should look like this:

code.gif

Thanks.
User is offlineProfile CardPM

Go to the top of the page

Fast ReplyReply to this topicStart new topic
Time is now: 10/12/08 08:18AM

Live VB Help!

VB Tutorials

Reference Sheets

VB Snippets

Bye Bye Ads

Free DIC T-Shirt

T-Shirt Example

Related Sites

Monthly Drawing

Thumb Drive

Partners

Top Contributors

Top 10 Kudos This Month