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 gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

make remote view from access table mdb 1

Status
Not open for further replies.

ameedoo3000

IS-IT--Management
Sep 20, 2016
233
EG
how can i make remote view from MS access table
tried a lot but the data is not clear and every time I open the remote view asked to locate the database again. What do I do and what is the best way to connect the Access table to the Fox Pro.
 
Which way are you trying? Using DBF in Access or an Access table in VFP?

Here you have connection strings to Access DBs:
A remote view will need a connection object in a DBC establishing such a connection. And for sake of not needing to locate the database again and again, well, it needs to be in a specific location, just like a DBF, an mdb or accdb or accbd file depending on the version.

I donÄt know what changes, in Access just like in VFP you could create new tables, you easily have moving targets if you create DBFs per day and Access tables per day, you will also need new remote views per day.

Either you have changing file locations changing databases, new tables per day or you don't store the DBC with the connection object and don't save your remote view in it. But it's not hard to have a DBC for remote views to a certain access db that works as long as the access db exists.

Bye, Olaf.

Olaf Doschke Software Engineering
 
First, I agree with you that Fox Pro is much better than Ms access in the possibilities and ease of handling data, etc.

Second, I resorted to the way to connect an Access table within the Fox Pro for the use of existing data in the Access and deal with it within the environment of the Fox Pro ... This confirms the superiority of the Fox Pro on the Access

Thirdly, I thank you for giving me the link on how to link the Access with the Fox Pro, and I have tried this link but there is a problem I hope it is simple and has a solution that is that some data appear in the table field as a memo. What is the reason and how to get rid of this phenomenon
With sincere thanks and appreciation ....
Ahmed
 
Hello Ahmed,

no need to praise VFP or degrade Access. It's fine for its purposes and it's easy to see you have a reason to connect to data from an Access application. I was just thinking about the reasons your connection was always asking for the database.

I guess you now successfully made a connection and queried data and now you're puzzled about the outcome of fields data type mapping. Without details, we're not able to help you. In general all databases have different data types and some don't map automatically. You have the possibility to specify a target data types.

So What is the structure of the Access table, what field types do you have there and what turns into a memo in VFP? How do you connect now, did you use the info I gave you to make a connection object or a DSN or make a connection via SQLStringConnect? In short: What does things look like, can you post Access code or screenshots of the tables composition and your VFP code? View definition?

You know that we can only see what you show us, so please, don't just report symptoms. You're not at a doctor, who can start examining you after you tell him your symtoms and pains. We don't have hands on your computer, do we?

Bye, Olaf.





Olaf Doschke Software Engineering
 
With all the love, respect and appreciation for your guesses why to ask about the connection to the Access database
I will explain to you the Amauracather until the full picture is clear to you, my dear Olaf
First of all, I love the Fox Pro very, very very much and I found a lot of fun and many easy solutions to the problems I was encountering in Access. , But this does not mean that there are very few obstacles .. Always the beautiful thing is not complete. But in any case it is much better than Access.
Now explain the problem in detail and images.
1_q1ietj.png

2_dxdoac.png

3_flpd2b.png

4_nfj7ax.png

5_smyuxy.png

6_ebt1oo.png

7_ifvucr.png
 
Ok, thank you for the details. I'm not an Access Expert, but I think the field type "Text" all your Access table fields have, corresponds to VFPs Memo.
So I would even expect all the columns to come over as Memo fields in VFP.

You can right-click in the grey area of the remote view designer and get a context menu with one menu item being "View SQL". Besides the SQL query you'll find a lot of DbSetProp code lines like this one:
Code:
DBSetProp(ThisView+".fieldname","Field","DataType","I")
Where the last single letter parameter is the type in its short single letter notation I for integer, M for memo, C for character, etc. There's a list of data type letters in the VFP help somewhere. You would have such lines with .name, .class, etc. and now look at what the data type letter for .Name is, it should be M for memo, look at what it is for the other fields. You can change it from Memo to C(100) or whatever other comparable fields have.

You'll need an ANSI code page for Arabic, I guess you will not be able to see the Arabic characters in VFP, as VFP isn't capable of Unicode, but you surely can get whatever field type (as long as it makes sense) that you want by changing that view property available for each view field.

Bye, Olaf.


Olaf Doschke Software Engineering
 
By the way, it's no good idea to store anything in data type Text, You only store single letters into Second Language and Class, you could use Char(1) for that, also you only have class A or B, that asks for a Boolean only bing 0 or 1 and at display translated to A or B. Etc. The Grade field always says "Nth grade primary", it's sufficient to store the integer number and translate that to "Nth grade primary" only when displaying it, that can be stored in an integer data type field. Either you translate 1 to First, 2 To Second etc. to show the words or you bring it down to number + "th grade primary" and maybe make 1 2 and 3 special cases with "st","nd" and "rd" instead of "th". Anyway, use the data types more wisely. There's a reason there are more than just the text data type, you want to be able to calculate with numbers or dates or prices in currencies and more. Think alone about sorting by grade, S as in "Second" comes after F as in "Fourth", but should sort before it. So only when you store rade as numeric you can sort by it easily.

Bye, Olaf.

Olaf Doschke Software Engineering
 
Dear Olaf
thank you very much
I have followed your instructions and have been successfully working and thanks for your back
Thank you very much .. And always and ever learn from you everything that is useful and upscale
%D8%AC%D8%AF%D9%8A%D8%AF_ergmbe.png
 
Ahmed,

Good to see that Olaf has helped you solve the problem.

You were right to thank him for doing so, but did you know that the forum has a special mechanism that lets you place a star against any post that you find particularly helpful? This is useful, because if other people have a similar problem, it helps them locate a satisfactory answer.

You just jave to click "Great Post" in the bottom-right of the post.

Mike

__________________________________
Mike Lewis (Edinburgh, Scotland)

Visual FoxPro articles, tips and downloads
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top