If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Data Access, Manipulation & Batch Languages > Delphi, C etc > Is this possible?

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 06-28-04, 03:28
sarduakar sarduakar is offline
Registered User
 
Join Date: Jun 2004
Posts: 5
Post Is this possible?

I am a new user to visual basic 6. Can I access Access files(*.mdb) using visual basic 6.0 using ADO jet engine without having Access installed on my computer.
Can anyone help me out?
Reply With Quote
  #2 (permalink)  
Old 06-28-04, 12:22
SCIROCCO SCIROCCO is offline
Registered User
 
Join Date: Mar 2004
Location: www.scirocco.ca
Posts: 346
Yes you can. You do not need Access installed on your machine to access *.MDB files using VB and ADO.

Here is some sample code:

Code:
Dim cn as ADODB.Connection
Dim rs as ADODB.Recordset

Set cn = new ADODB.Connection
cn.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;User ID=Admin;Password=TestPass;Data Source=C:\Test.mdb;Persist Security Info=False;Exclusive=0"
cn.open

set rs = new ADODB.recordset
rs.ActiveConnection = cn
rs.Open "SELECT * FROM Table1"

rs.Close
cn.Close
Set rs=Nothing
Set cn = Nothing
__________________
http://www.scirocco.ca/images/banner...occobanner.gif

Download for FREE the ADO/DAO Data Controls that makes life EASIER developing database applications in: VB, FoxPro, Access, VC++, .NET etc... Navigate, Add New, Delete, Update, Search, Undo and Save your changes. Supports Disconnected Recordsets and Transactions!

Or try our Ask An Expert service to answer any of your questions!
Reply With Quote
  #3 (permalink)  
Old 06-29-04, 02:07
sarduakar sarduakar is offline
Registered User
 
Join Date: Jun 2004
Posts: 5
Thanks SCIROCCO
Reply With Quote
Reply

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 On
Pingbacks are On
Refbacks are On