Solved

Use ADO to join a free dbf table with a table in dbc database.

Posted on 2001-07-24
8
454 Views
Last Modified: 2013-11-23
How can I use ADO to join a free table dbf with a table in the dbc database. ADO can only establish one connection, however the database and the free table are in different location. What can i do ??
0
Comment
Question by:twong84
  • 4
  • 3
8 Comments
 
LVL 12

Expert Comment

by:DRRYAN3
ID: 6313718
Create another ADO connection for your free table and open a recordset for the free table referencing your new ADO connection.
0
 

Author Comment

by:twong84
ID: 6313824
Do you mean open the recordset for the free table referencing the old ADO connection for the database ???.
How can i reference to another ado connection ???
0
 
LVL 12

Expert Comment

by:DRRYAN3
ID: 6313888
Are you trying to join the two tables into a single recordset with an SQL query?  If not, declare two connection objects:

dim strConnect as string
dim strSQL as string
dim cn1 as new adodb.connection
dim cn2 as new adodb.connection
dim rs1 as new adodb.recordset
dim rs2 as new adodb.recordset

strConnect = "Connection String for First Connection"
cn1.open strConnect
strConnect = "Connection String for Second Connection"
cn2.open strConnect

strSQL = "SELECT * FROM Table1"
rs1.open strSQL, cn1, adOpenForwardOnly, adLockReadOnly
strSQL = "SELECT * FROM Table2"
rs2.open strSQL, cn2, adOpenForwardOnly, adLockReadOnly

0
3 Use Cases for Connected Systems

Our Dev teams are like yours. They’re continually cranking out code for new features/bugs fixes, testing, deploying, testing some more, responding to production monitoring events and more. It’s complex. So, we thought you’d like to see what’s working for us.

 

Author Comment

by:twong84
ID: 6313904
Yes, I am trying to join two tables into a single recordset with an SQL query.
However, one table is a free table(dbf). Another table is in the dbc database.

Any suggestion ???
0
 

Author Comment

by:twong84
ID: 6313911
Yes, I am trying to join two tables into a single recordset with an SQL query.
However, one table is a free table(dbf). Another table is in the dbc database.

Any suggestion ???
0
 

Accepted Solution

by:
BlackShark earned 50 total points
ID: 6313958
ADD TABLE Command
Adds a free table to the current database.
ADD TABLE TableName | ?
  [NAME LongTableName]
i'm not sure odbc driver supports this, but you can try:
YourConnection.Execute("ADD TABLE YourTable")
0
 
LVL 12

Expert Comment

by:DRRYAN3
ID: 6313983
Still looking, but one suggestion is to use an Access MDB and link to the various DBF files.  Set your connection to the .MDB file and query away.  If you want to create this type of setup in code, see http://support.microsoft.com/support/kb/articles/Q230/5/88.ASP?LN=EN-US&SD=gn&FR=0&qry=tables&rnk=15&src=DHCS_MSPSS_gn_SRCH&SPR=ADO
0
 

Author Comment

by:twong84
ID: 6314049
Thanks DRRYAN3, that's what in my mind too.
I appreciate alot for your help.
0

Featured Post

ScreenConnect 6.0 Free Trial

Explore all the enhancements in one game-changing release, ScreenConnect 6.0, based on partner feedback. New features include a redesigned UI, app configurations and chat acknowledgement to improve customer engagement!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Tembedded WB animatid gifs not animated on some pcs 2 80
Recommendation vb6 to vb.net or others 14 151
Macro Excel - Multiple If conditions 2 73
vbModal 12 53
When designing a form there are several BorderStyles to choose from, all of which can be classified as either 'Fixed' or 'Sizable' and I'd guess that 'Fixed Single' or one of the other fixed types is the most popular choice. I assume it's the most p…
Introduction I have seen many questions in this Delphi topic area where queries in threads are needed or suggested. I know bumped into a similar need. This article will address some of the concepts when dealing with a multithreaded delphi database…
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…

831 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