943,937 Members | Top Members by Rank

Ad:
Jul 11th, 2007
0

How can i access data from MS Access using VB6 (I need the connection code)

Expand Post »
How can i access data from MS Access using VB6 (I need the connection code) can u plz tell me the code for accessing tables in MS Access using Visual Basic 6. my access tables are in a server not in my local computer..... plz let me know the code
Similar Threads
Reputation Points: 10
Solved Threads: 3
Light Poster
guru511 is offline Offline
42 posts
since Jul 2007
Jul 11th, 2007
0

Re: How can i access data from MS Access using VB6 (I need the connection code)

Hi,

Get Connection String here:

http://www.connectionstrings.com/?carrier=access

Change the Path to Server Path.

Regards
Veena
Reputation Points: 84
Solved Threads: 140
Posting Shark
QVeen72 is offline Offline
923 posts
since Nov 2006
Jul 11th, 2007
0

Re: How can i access data from MS Access using VB6 (I need the connection code)

'using connection object

'in general section
dim conn as adodb.connection
dim rs as adodb.recordset

'in form load
set conn=new adodb.connection
set rs=new adodb.recordset

conn="provider=microsoft jet.4.0.oledb;data source=<ur database name>;persist security info=false"
conn.open
rs.open "select *from ur tablename",conn,adopendynamic,adlockoptimistic
Reputation Points: 30
Solved Threads: 49
Posting Pro
choudhuryshouvi is offline Offline
553 posts
since May 2007
Jul 11th, 2007
0

Re: How can i access data from MS Access using VB6 (I need the connection code)

will this work for a database which is in a server not in my local computer
Reputation Points: 10
Solved Threads: 3
Light Poster
guru511 is offline Offline
42 posts
since Jul 2007
Jul 11th, 2007
0

Re: How can i access data from MS Access using VB6 (I need the connection code)

thanq mr.choudhuryshouvi

will that work for a database which is in a server not in my local computer...
Reputation Points: 10
Solved Threads: 3
Light Poster
guru511 is offline Offline
42 posts
since Jul 2007
Jul 11th, 2007
0

Re: How can i access data from MS Access using VB6 (I need the connection code)

Hi,,

Add "Microsoft ActiveX objects 2.0" References to the project. Share the Folder in Server With Full Access.
use this code:


Dim rs As New ADODB.Recordset
Dim AC As New ADODB.Connection
With AC
.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=\\ServerName\ShareFolder\db1.mdb;Persist Security Info=False"
.Open
End With
ssql = "Select * from MyTable"
Set rs=Nothing
RS.Open ssql,AC

REgards
Veena
Reputation Points: 84
Solved Threads: 140
Posting Shark
QVeen72 is offline Offline
923 posts
since Nov 2006
Jul 11th, 2007
0

Re: How can i access data from MS Access using VB6 (I need the connection code)

Thanq very much veena
guru
Reputation Points: 10
Solved Threads: 3
Light Poster
guru511 is offline Offline
42 posts
since Jul 2007

This thread is more than three months old

No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.
Message:
Previous Thread in Visual Basic 4 / 5 / 6 Forum Timeline: .:: Web Login Help ::.
Next Thread in Visual Basic 4 / 5 / 6 Forum Timeline: sending mails using Visual Basic 6





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC