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

Import questions and filter problem

Status
Not open for further replies.

woodyinoz

IS-IT--Management
Jan 8, 2002
215
GB
Hi all,

Ok, here goes, these problems have been mind numbingly painful for me so any help would be much appreciated!

1. I want to use ObjectPal to import a chosen text file into an already structured Paradox table. This would preferably be done using a file browser, like the ones used to open/save files.

2. I want to import information from an Access table into a Paradox table every night. The Access table is always the same and is always in the same location so no file selection would be needed here.

3. And finally, how do I get around the problem of filtering fields which contain '-', 'X', '/' etc...?

Any help with these questions would be great.

Thanks in advance,

Woody
 
1. These codes would allow you to select a Text file.

Var
fbi FileBrowserInfo
sSelectedFile String
endvar

fbi.Path = "C:\\"
fbi.AllowableTypes = fbASCII
fileBrowserEx(sSelectedFile, fbi)
MsgInfo("You have selected",sSelectedFile)

If the import data are fixed length, use a ImportASCIIFix with data spec table.
If the import data are comma delimited, import data using ImportASCIIVar into a temp table, then add them to the data table using Add command.

2.
You can use ODBC Data Source Administrator to set up the MS-Access connection (you should find it in your control panel) or export the data from Access to ASCII or dBase table.

3.
How are you filtering the data?


 
Cheers for that JoeNg,

I'm filtering the table by simply right clicking the appropriate field and then typing in what to filter by but it doesn't like 'M-01' for example and brings up the following error -

&quot;The filter expression in field <fieldname> is not valid.&quot;
 
To filter M-10, you need to type M\-01.

This is from Pdox help file. For the full description, go to Help | Help Topics and type in filtering tables
....
Filtering on special characters

If you are filtering on special characters, you must precede the number or literal value that can be interpreted as an operator (like &quot;, /, \, -, +, =, etc.) with a backslash(\). In the OPAL method setgenfilter(), the filter criteria is put into a string and parsed to pick out numbers and operators for calculations. If the number or operator in the filter needs to be interpreted literally, it needs to be preceded by a backslash(\).

For example, to filter a table with the following records:

· 1st Base
· 1st Love
· 2nd Base
· 3rd Base

and retrieve only those that start with &quot;1st,&quot; the filter would look like the following:

filter = &quot;\1st..&quot;

One backslash to indicate that number 1 is not a special characte

 
Ooops, I mean to say...

To filter M-01, you need to type M\-01.

Not

To filter M-10, you need to type M\-01.



 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top