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

Run QBE in method using alias

Status
Not open for further replies.

paulvos

Technical User
Aug 1, 2001
8
0
0
NL
I want to run a QBE inside a method. For this I have made a QBE file and imported the ascii version in the method. This approach works fine inside the working directory. However if I need to query a database in a different directory or on a different disk this does not work, not even if I define an alias. After running the method I find the alias in the directory viewer of the project viewer, but still the answer comes up empty. Running the same query by hand does give a result.

Can anyone give me a working method, so I can build from there? I'm running Paradox 9 on W2000
 
Please post the code. If the alias is defined and also included in the query text, then there is no reason it should not work.

i.e.

Code:
q=query

:myalias:mytable.db | field1 | field2 |
                    | check  | check  |

endQuery

Mac :)

"Strange women lying in ponds and distributing swords is no basis for a system of government" - Dennis, age 37

mailto:langley_mckelvy@cd4.co.harris.tx.us
 
Dear Mark,

Here is the used code:


method pushButton(var eventInfo Event)

Var
Salesinfo Database
Verkoop String
Sales String
Date1 String
Date2 String
Maand String
cDate1 Date
cDate2 Date
RepV Report
Info1 ReportPrintInfo
Info2 ReportPrintInfo
qVar Query
FM Form
tv TableView
Endvar

Maand.View("Voor welk maandnummer? (mm): ")
Grpvrdmnd="Grpvrd"+Maand+".dbf"

addAlias("Archie","Standard","F:\\archie8\\data")

qVar=Query

:Archie:ART000.DBF | ARTNR | GROEP | KOSTPRIJS |
| Check not *.. | Check | _1, calc sum as Kost |

:Archie:ART000.DBF | STAFFEL | VRD |
| calc _1*_2 as Waarde | _2, >0, calc sum as Vrd |

:Archie:ART000.DBF | RES | VRK |
| calc sum as Geres | calc sum as Verk |

:Archie:ART000.DBF | BST |
| calc sum as Best |

:Archie:TAB000.DBF | K | T01 |
| Check _a | Check |

EndQuery

qVar.executeQBE("test.dbf")

tv.open("test.dbf")


endMethod
 
try:

if not qVar.executeQBE("test.dbf") then
errorshow()
endif

and see if you get an errormessage
Richie


 
Check out PARADOX 9 Help | ObjectPal Reference "executeQBE example 2" for correct syntex and methodology for querying a foreign database.
 
I see no corresponding link to _a in the table :Archie:ART000.DBF

Mac :)

"Do not delve too deeply in the arts of your enemy and so become ensnared by them"

langley_mckelvy@cd4.co.harris.tx.us
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top