Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 4608398
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T00:50:22+00:00 2026-05-22T00:50:22+00:00

I converted visual foxpro DBF to mysql and I need to connect the vfp

  • 0

I converted visual foxpro DBF to mysql and I need to connect the vfp code directly to the mysql database.Please help.thanks

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-22T00:50:23+00:00Added an answer on May 22, 2026 at 12:50 am

    There are a number of ways to access data from a server database from VFP, but I’m not sure you’d call any of them connecting directly to the server database. Specifically, you can’t use commands like USE and REPLACE directly against a server database, nor can you bind form controls directly to the server data.

    Whichever approach you use, you pull some data from the server into a cursor in VFP, operate on the cursor, and then, if appropriate, save changes back to the server.

    The three main approaches are:

    1) Remote views–with this approach, you store SQL queries in a database. To run the query and pull data from the server, you USE the remote view.
    2) SQL Pass-Through (SPT)–with this approach, you use the SQLEXEC() command to send SQL commands to the server, and get results.
    3) CursorAdapter class–with this approach, you set up a class that describes how you want to get data from the server, and when you call the CursorFill() method, you get a cursor full of data.

    You should choose one of these approaches and use it throughout your application. They each have pros and cons.

    To get you started, since you’ll probably want to use SPT for testing purposes (like in the Command Window) anyway, here’s the basics of that approach:

    First, you have to connect to the database. You do that with either the SQLConnect() or SQLStringConnect() function. For example:

    • You’ll need to fill in your userid and password where indicated.
      nHandle = SQLStringConnect(“driver={MySQL ODBC 5.1 Driver};SERVER=localhost;UID=;pwd=”)

    A positive value for nHandle indicates success. Once you have a handle, you use it to send additional commands. For example:

    nSuccess = SQLEXEC(m.nHandle, “SELECT First, Last FROM Customers WHERE State=’PA'”, “csrPACustomers”)

    That tells MySQL to execute the query you pass in and put the results in csrPACustomers. nSuccess indicates success or failure.

    When you’re done, use SQLDisconnect() to close your connection:

    SQLDisconnect(m.nHandle)

    You can read about all three approaches to remote data in the VFP Help file and on the VFP Wiki (http://fox.wikis.com). Once you decide which approach you want to use, you can ask specific questions.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have to convert .DBF and .FPT files from Visual FoxPro to MySQL. Right
In Short: I'm using VB.NET 2008 to connect to a Visual Foxpro 6 Database
I have a huge collection of visual foxpro dbf files that I would like
I have a Visual Fox Pro Database (.DCX file with associated .DBF files) that
I have just converted a project from Visual Studio 2003 to 2005 and although
I recently converted a multi-project Visual Studio solution to use .dlls instead of .libs
I converted my project from MVC 1 to MVC 2 and Visual Studio 2008
I have a GUI C++ application (Visual Studio 2008) that needs to be converted
I have successfully connected to an Oracle database (10g) from C# (Visual Studio 2008)
I've converted a Visual Studio 2005 Website Project into a Web Application Project by

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.