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

Reply

Join Date: Jul 2007
Posts: 42
Reputation: guru511 is an unknown quantity at this point 
Solved Threads: 3
guru511's Avatar
guru511 guru511 is offline Offline
Light Poster

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

 
0
  #1
Jul 11th, 2007
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
Reply With Quote Quick reply to this message  
Join Date: Nov 2006
Posts: 848
Reputation: QVeen72 is on a distinguished road 
Solved Threads: 120
QVeen72's Avatar
QVeen72 QVeen72 is offline Offline
Practically a Posting Shark

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

 
0
  #2
Jul 11th, 2007
Hi,

Get Connection String here:

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

Change the Path to Server Path.

Regards
Veena
Reply With Quote Quick reply to this message  
Join Date: May 2007
Posts: 537
Reputation: choudhuryshouvi is an unknown quantity at this point 
Solved Threads: 49
choudhuryshouvi's Avatar
choudhuryshouvi choudhuryshouvi is offline Offline
Posting Pro

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

 
0
  #3
Jul 11th, 2007
'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
Reply With Quote Quick reply to this message  
Join Date: Jul 2007
Posts: 42
Reputation: guru511 is an unknown quantity at this point 
Solved Threads: 3
guru511's Avatar
guru511 guru511 is offline Offline
Light Poster

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

 
0
  #4
Jul 11th, 2007
will this work for a database which is in a server not in my local computer
Reply With Quote Quick reply to this message  
Join Date: Jul 2007
Posts: 42
Reputation: guru511 is an unknown quantity at this point 
Solved Threads: 3
guru511's Avatar
guru511 guru511 is offline Offline
Light Poster

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

 
0
  #5
Jul 11th, 2007
thanq mr.choudhuryshouvi

will that work for a database which is in a server not in my local computer...
Reply With Quote Quick reply to this message  
Join Date: Nov 2006
Posts: 848
Reputation: QVeen72 is on a distinguished road 
Solved Threads: 120
QVeen72's Avatar
QVeen72 QVeen72 is offline Offline
Practically a Posting Shark

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

 
0
  #6
Jul 11th, 2007
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
Reply With Quote Quick reply to this message  
Join Date: Jul 2007
Posts: 42
Reputation: guru511 is an unknown quantity at this point 
Solved Threads: 3
guru511's Avatar
guru511 guru511 is offline Offline
Light Poster

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

 
0
  #7
Jul 11th, 2007
Thanq very much veena
guru
Reply With Quote Quick reply to this message  
Reply

This thread is more than three months old.
Perhaps start a new thread instead?
Message:



Similar Threads
Other Threads in the Visual Basic 4 / 5 / 6 Forum
Thread Tools Search this Thread



About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC