Solved

Access 2002 connection to Paradox using ADO

Posted on 2003-12-07
11
418 Views
Last Modified: 2008-02-26
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, copying records from these two tables, and then closing the connection?  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...
0
Comment
Question by:cpopham
  • 5
  • 5
11 Comments
 
LVL 23

Expert Comment

by:heer2351
ID: 9893267
0
 
LVL 26

Accepted Solution

by:
Alan Warren earned 200 total points
ID: 9893312
Hi cpopham


http://www.able-consulting.com/MDAC/ADO/Connection/ODBC_DSNLess.htm#ODBCDriverForParadox

Set up your connection string as depicted in the link above.


Private Sub Somesub()
'Reference: Microsoft ActiveX data objects 2.xx Library

dim oConn as adodbb.connection
set oconn = new adodb.connection
dim rs as adodb.recordset
set rs = new adodb.recordset

' Copied from the link above
oConn.Open "Driver={Microsoft Paradox Driver (*.db )};" & _
           "DriverID=538;" & _
           "Fil=Paradox 5.X;" & _
           "DefaultDir=c:\dbpath\;" & _
           "Dbq=c:\dbpath\;" & _
           "CollatingSequence=ASCII"

oConn.CursorLocation = adUseClient

dim sql as string
sql = "select yourfield from yourtable"
Rs.CursorLocation = adUseClient
Rs.Open sql, oConn, adOpenStatic, adLockOptimistic, adCmdText

End Sub

Alan :)
0
 
LVL 23

Expert Comment

by:heer2351
ID: 9893338
He Alan since when do you have access to my favorites :)
0
 
LVL 26

Expert Comment

by:Alan Warren
ID: 9893380
Hi Hans,

Able-consulting are good resource, in my favourites too.
Also number 1 find in google when searching for connection strings

I think originally it may have been you who put me onto able-consulting.

Regards

Alan :)
0
 
LVL 23

Expert Comment

by:heer2351
ID: 9893437
Alan,

I was just smiling when I saw that you posted exactly the same link, could not resist to post a little joke.

However you took the time to hack up an example which is probably required when I read the question.

OT: Have you already found a store to buy a Sage costume, I might also be needing it in some time ....

Hans
0
How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

 
LVL 26

Expert Comment

by:Alan Warren
ID: 9893457
LOL

No just budgeting for it at the moment...Still don't know if I need a horse too!

:)
0
 
LVL 23

Expert Comment

by:heer2351
ID: 9893485
I hope the store accepts EE points for payment if we also need a horse.

However I think a beard and grey hair will suffice.

\Sage\, n. A wise man; a man of gravity and wisdom; especially, a man venerable for years, and of sound judgment and prudence; a grave philosopher.

0
 
LVL 26

Expert Comment

by:Alan Warren
ID: 9893598
I reckon EE should provide them, required resources to fulfill our duty and all that stuff. I got both beard and long grey hair naturally, bit of an old hippie from the 70's.

Alan :)
0
 
LVL 23

Expert Comment

by:heer2351
ID: 9893624
So I guess you are a real Sage!

No beard, no grey hair (well a few), I guess I have to stay an apprentice for a while.
0
 

Author Comment

by:cpopham
ID: 9896309
Thanks guys,

When I ran it, the compiler did not like the statement:

rs.Open sql, oConn, adOpenStatic, adLockOptimistic, adCmdText

It gave me a runtime error and said invalid sql statement.  Expected 'INSERT', 'DELETE', blah, blah.

Also, if I put a network user ID and password in the code liek this will it work to let it basically sign on?

oConn.Open "Driver={Microsoft Paradox Driver (*.db )};" & _
           "DriverID=538;" & _
           "Fil=Paradox 5.X;" & _
           "DefaultDir=p:\fleet\;" & _
           "Dbq=p:\fleet\;" & _
           "Exclusive=False" & _
           "PARADOXNETPATH=P:\Pdata" & _
           "PARADOXUSERNAME=teamptr" & _
           "PWD=redrum101" & _
           "CollatingSequence=ASCII"
0
 
LVL 26

Expert Comment

by:Alan Warren
ID: 9900123
thats good news, you have a connection then!

What was the sql you contructed, can you post it here?

Alan :)
0

Featured Post

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

Suggested Solutions

When you are entering numbers in a speadsheet, and don't remember what 6×7 is, you just type “=6*7" instead. It works in every cell! This is not so in Access. To enter the elusive 42 in a text box, you have to find a calculator, and then copy the re…
Today's users almost expect this to happen in all search boxes. After all, if their favourite search engine juggles with tens of thousand keywords while they type, and suggests matching phrases on the fly, why shouldn't they expect the same from you…
Familiarize people with the process of utilizing SQL Server stored procedures from within Microsoft Access. Microsoft Access is a very powerful client/server development tool. One of the SQL Server objects that you can interact with from within Micr…
In Microsoft Access, learn how to “cascade” or have the displayed data of one combo control depend upon what’s entered in another. Base the dependent combo on a query for its row source: Add a reference to the first combo on the form as criteria i…

760 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

18 Experts available now in Live!

Get 1:1 Help Now