Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

how to show MySQL table content in a form?

Status
Not open for further replies.

Gerrit Broekhuis

Programmer
Joined
Aug 16, 2004
Messages
316
Location
NL
Hi,

I've created a table CVIS in a MYSQL database "WinVIS"
and now I'm trying to make a form to navigate through the content of the CVIS table. I created a connection to this database in the Project Manager.

Now I want to show the records of the CVIS table in a form, with VCR style navigation buttons. I tried for a while, but in my form I can't get the table content visible. The fields remain empty, without error message.

Which RecordSource/DataSource reference should I use for QSL Pass-Through Functions? What should I pay attention to? Which button class fits best to navigate (incl. edit/delete/add, etc.)?

Regards, Gerrit

 
I created a connection to this database in the Project Manager.

Have you created a remote view? If so does it have records?


Mike Gagnon

If you want to get the best response to a question, please check out FAQ184-2483 first.
 
Gerrit,

The easiest way is as follows:

1. Create a remote view into the table, based on your connection object (which you already have).

2. Drop the view into the form's data environment, and drag fields from there to the form.

3. In your navigation buttons, select the view, perform the navigation (e.g. SKIP), refresh the form.

Give it a try, and report back if it doesn't work.

Mike


__________________________________
Mike Lewis (Edinburgh, Scotland)

My sites:
Visual FoxPro (www.ml-consult.demon.co.uk)
Crystal Reports (www.ml-crystal.com)
 
Hi Mike & Mike,

I have created a remote view and the form now displays data at last when running the form from the project manager.

When building an .EXE I get an error "Error loading file - record number 4.form1 <or one of its members>. Loading form or the data environment : file access is denied c:\mysql\winvis.dbc."

The database c:\mysql\winvis.dbc was created in order to be able to create the remove view.

In my start.prg I only have 2 lines:
DO FORM "myform.scx"
READ events

In the data environment of my form I only have the remove view.

How do I compile this project properly?

Regards, Gerrit
 
Gerrit,

My guess is that this is a pathing problem. Assuming the form does not have a private data session, try either SET PATH to the DBC, or OPEN DATABASE the DBC, before you launch the form.

Mike

__________________________________
Mike Lewis (Edinburgh, Scotland)

My sites:
Visual FoxPro (www.ml-consult.demon.co.uk)
Crystal Reports (www.ml-crystal.com)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top