?
Solved

I have 4 FoxPro Tables and 3 MS Access I need to Read Records in Tables

Posted on 2008-10-06
9
Medium Priority
?
214 Views
Last Modified: 2012-05-05
I have the data driver for FoxPro Installed.

I am using OLEDB so it doesn't matter the Database type.

I have 2 DataSet generated graphically.  (one for FoxPro and the other  Access)
 I would like to write code only (or maybe use code with the 2 graphically generated DataSets)


Steps I think I need:
Connection
DataSet
TableAdapter
Advance Record
Specify Field with String, not hard coded (i.e. strMyField = recRecord(strField))
0
Comment
Question by:JPTenore
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 5
  • 4
9 Comments
 

Author Comment

by:JPTenore
ID: 22656110
Back in 30mins
0
 

Author Comment

by:JPTenore
ID: 22656826
No Comments Yet?!?  Maybe if I Break it up?
0
 
LVL 53

Expert Comment

by:Dhaest
ID: 22657045
FoxPro tables can come in either of two formats. They can be "free" tables, meaning that each table is independent of the others, or they can be part of a "database container" which holds metadata and allows additional features for the tables. If you see a file with a DBC extension then you've got a database.

Here are two connection strings:

*-- Free table directory
Provider=VFPOLEDB.1;Data Source=C:\My Documents\Visual FoxPro
Projects;Password="";Collating Sequence=MACHINE

*-- Database Container
Provider=VFPOLEDB.1;Data Source=C:\My Documents\Visual FoxPro
Projects\Test.DBC;Password="";Collating Sequence=MACHINE

(http://www.connectionstrings.com/)
 Using connection as new OleDbConnection("Provider=VFPOLEDB.1;Data Source=C:\My Documents\Visual FoxPro Projects;Password='';Collating Sequence=MACHINE")
     connection.Open()
     ' Use the connection
 End Using

Open in new window

0
What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

 

Author Comment

by:JPTenore
ID: 22657117
WiFi went down, let me catch up
0
 

Author Comment

by:JPTenore
ID: 22657135
That Answers one Question I have Posted.  Also the FroPro data is 'Free Table'

Ask a Question for each step

Steps I think I need:
Connection (3 Questions for each Access, FoxPro, SQL Server)
DataSet
TableAdapter
Advance Record
Specify Field with String, not hard coded (i.e. strMyField = recRecord(strField))


You just got Connection - FoxPro (Hold on I will ask it)
0
 
LVL 53

Expert Comment

by:Dhaest
ID: 22657153
1. Connections:
- A. Foxpro (OLEDB)
Provider=VFPOLEDB.1;Data Source=C:\My Documents\Visual FoxPro Projects;Password="";Collating Sequence=MACHINE
- B. Access  (OLEDB)
Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:\mydatabase.mdb;User Id=admin;Password=;
http://connectionstrings.com/?carrier=access
- C. SQL-server (SQLConnection)
Data Source=myServerAddress;Initial Catalog=myDataBase;User  Id=myUsername; Password=myPassword;
http://connectionstrings.com/?carrier=sqlserver2005
0
 
LVL 53

Expert Comment

by:Dhaest
ID: 22657156
2. Filling a dataset

Filling a DataTable or DataSet the Quick Way
http://imar.spaanjaars.com/QuickDocId.aspx?quickdoc=406
private DataTable GetDataTable()
{
  string sql = "SELECT Id, Description FROM MyTable";
  using (SqlConnection myConnection = new SqlConnection(connectionString))
  {
    using (SqlCommand myCommand = new SqlCommand(sql, myConnection))
    {
      myConnection.Open();
      using (SqlDataReader myReader = myCommand.ExecuteReader())
      {
        DataTable myTable = new DataTable();
        myTable.Load(myReader);
        myConnection.Close();
        return myTable;
      }
    }
  }
}		

Open in new window

0
 

Author Comment

by:JPTenore
ID: 22657157
Here is the Question you Answered  ID:23792892   500pts. A Grade just post last Comment there
0
 
LVL 53

Accepted Solution

by:
Dhaest earned 2000 total points
ID: 22657170
4. Loop datatable

        Dim dr As DataRow
        For Each dr In ds.Tables(0).Rows
            Dim i As Integer
            For i = 1 To ds.Tables(0).Columns.Count
                Console.Write("{0,15}", dr(i - 1))
            Next i
            Console.Write(vbCrLf)
        Next

Open in new window

0

Featured Post

Enroll in August's Course of the Month

August's CompTIA IT Fundamentals course includes 19 hours of basic computer principle modules and prepares you for the certification exam. It's free for Premium Members, Team Accounts, and Qualified Experts!

Question has a verified solution.

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

I’ve seen a number of people looking for examples of how to access web services from VB6.  I’ve been using a test harness I built in VB6 (using many resources I found online) that I use for small projects to work out how to communicate with web serv…
Since upgrading to Office 2013 or higher installing the Smart Indenter addin will fail. This article will explain how to install it so it will work regardless of the Office version installed.
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
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…
Suggested Courses
Course of the Month14 days, 20 hours left to enroll

771 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