User Name Password Register
DaniWeb IT Discussion Community
All
What is DaniWeb IT Discussion Community?
You're currently browsing the Visual Basic 4 / 5 / 6 section within the Software Development category of DaniWeb, a massive community of 397,846 software developers, web developers, Internet marketers, and tech gurus who are all enthusiastic about making contacts, networking, and learning from each other. In fact, there are 2,437 IT professionals currently interacting right now! Registration is free, only takes a minute and lets you enjoy all of the interactive features of the site.
Please support our Visual Basic 4 / 5 / 6 advertiser:
Views: 1888 | Replies: 6
Reply
Join Date: Jul 2007
Location: bangalore
Posts: 42
Reputation: guru511 is an unknown quantity at this point 
Rep Power: 2
Solved Threads: 3
guru511's Avatar
guru511 guru511 is offline Offline
Light Poster

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

  #1  
Jul 10th, 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
AddThis Social Bookmark Button
Reply With Quote  
Join Date: Nov 2006
Posts: 709
Reputation: QVeen72 is an unknown quantity at this point 
Rep Power: 3
Solved Threads: 95
QVeen72's Avatar
QVeen72 QVeen72 is offline Offline
Master Poster

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

  #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  
Join Date: May 2007
Location: India
Posts: 493
Reputation: choudhuryshouvi is an unknown quantity at this point 
Rep Power: 2
Solved Threads: 45
choudhuryshouvi's Avatar
choudhuryshouvi choudhuryshouvi is offline Offline
Posting Pro in Training

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

  #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  
Join Date: Jul 2007
Location: bangalore
Posts: 42
Reputation: guru511 is an unknown quantity at this point 
Rep Power: 2
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)

  #4  
Jul 11th, 2007
will this work for a database which is in a server not in my local computer
Reply With Quote  
Join Date: Jul 2007
Location: bangalore
Posts: 42
Reputation: guru511 is an unknown quantity at this point 
Rep Power: 2
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)

  #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  
Join Date: Nov 2006
Posts: 709
Reputation: QVeen72 is an unknown quantity at this point 
Rep Power: 3
Solved Threads: 95
QVeen72's Avatar
QVeen72 QVeen72 is offline Offline
Master Poster

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

  #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  
Join Date: Jul 2007
Location: bangalore
Posts: 42
Reputation: guru511 is an unknown quantity at this point 
Rep Power: 2
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)

  #7  
Jul 11th, 2007
Thanq very much veena
guru
Reply With Quote  
Reply

Only community members can participate in forum threads. You must register or log in to contribute.

Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)

 

DaniWeb Visual Basic 4 / 5 / 6 Marketplace
Thread Tools Display Modes

Similar Threads
Other Threads in the Visual Basic 4 / 5 / 6 Forum

All times are GMT -4. The time now is 7:57 am.
Forum system based on vBulletin Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
©2003 - 2008 DaniWeb® LLC