Wrox Programmer Forums
|
Access VBA Discuss using VBA for Access programming.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Access VBA section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old December 7th, 2003, 04:28 PM
Authorized User
 
Join Date: Dec 2003
Posts: 14
Thanks: 0
Thanked 0 Times in 0 Posts
Default ADO questions please help...

Okay, I am trying to connect to a Paradox table with Access 2002 and would like to use ADO to do it, but I am not to familiar with ADO and can not find many sources of very useful information on ADO. First of all the folder that I am using is: P:\ForACC and the folder and file that I am trying to connect to is: P:\Fleet\Fleet.db and another table I need to connect to is: P:\Fleet\lert.db. Can someone show me some sample code for connecting and copying records from these two tables? The records I need are from the Fleet table: VIN, Agency, Year, and lert and from the lert they are: Index and lert. These two tables are on a Novel Network. Is it possible for me to create a user with access rights to all of the above folders and then have the ado connection use the username and password to gain access to the tables and records that I need brought in? Thanks for the help...
 
Old January 3rd, 2004, 06:40 PM
Authorized User
 
Join Date: Oct 2003
Posts: 53
Thanks: 0
Thanked 0 Times in 0 Posts
Default

First of all you must establish a reference to the ADO library to access any of its functions or methods etc...
From the VBE window, you go to tools => references, from there, you will find a drop down box with a myriad of libraries to choose from.
The ADO library that you probably want is ;
"Microsoft ActiveX Data Objects 2.7 Library".
You must always first establish a connection. eg;
Dim remoteConnection As New ADODB.Connection
 With remoteConnection
      .Provider = "Microsoft.Access.OLEDB.10.0"
       .Properties("Data Provider").Value = "Microsoft.Jet.OLEDB.4.0"
       .Properties("Data Source").Value = eg; "C:\My Documents\MyAccess.mdb" (path of your Fleet Table)
        .Open
End With
 remoteConnection.Close

This should get you started.
(Finding the path was a little tricky for me on my Application).
There are more methods required to access certain files & manipulate them,
This code will merely establish a connection.
Good Luck!






Similar Threads
Thread Thread Starter Forum Replies Last Post
.NET Interview Questions, C# Interview Questions, dotnetuncle .NET Framework 2.0 4 June 22nd, 2019 07:03 AM
Difference between ADO and ADO.NET rakeshclose2u ADO.NET 2 April 23rd, 2007 03:57 AM
ADO AND ADO.NET royalsurej ADO.NET 1 November 8th, 2004 08:28 AM
ADO.NET Dataset Questions winnie1778 ADO.NET 1 October 20th, 2003 12:50 PM
ADO could ADO counot find the specified provider. Rob Collie Classic ASP Databases 2 June 9th, 2003 04:12 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.