dbTalk Databases Forums  

Sql Query

comp.databases.paradox comp.databases.paradox


Discuss Sql Query in the comp.databases.paradox forum.



Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old   
bspiteri@ozemail.com.au
 
Posts: n/a

Default Sql Query - 01-03-2008 , 01:24 AM






I have used sql queries in paradox events previoisly and had no
problems, I now to use a new ODBC driver, the sql builder works fine.
I have tried to put the code on a button and now the sql query fails.
my code is as follows. Can anyone help me. It fails at the execute
statment.

var
itemNameSQL SQL
ViewName tableview
db database
tc1,tc2,tc3 Tcursor
cus,sup,prt,so,sod Longint
ar1 Array[] anytype
dynalias Dynarray[] anytype
endVar

tc1.open("Update Integers.db")
so = tc1.LastSalesOrder

dynalias["USER NAME"] = "XX"
dynalias["PASSWORD"] = "xxxxxx "

db.open (":Altro Caliach:", dynalias)

; this will open the connection to the local table or SQL table via
the alias

itemNameSQL = SQL ; the following stores the SQL statement
into the variable

SELECT Omnis_sohfile.SOHCADS, Omnis_adrfile.ADRID,
Omnis_sohfile.SOHSONO
Omnis_sohfile.SOHCREF, Omnis_sohfile.SOHDATE, Omnis_sohfile.SOHDAQO,
Omnis_sohfile.SOHCUSC,
Omnis_adrfile.ADRCNAM, Omnis_adrfile.ADRADDR, Omnis_adrfile.ADRZIP,
Omnis_adrfile.ADRTEL,
Omnis_sohfile.SOHQVAD
FROM OMNIS.ADRFILE Omnis_adrfile, OMNIS.SOHFILE Omnis_sohfile
WHERE (Omnis_sohfile.SOHCADS = Omnis_adrfile.ADRID)
and Omnis_sohfile.SOHSONO > '~so'

endsql


IF NOT executeSQL(db, itemNameSQL, ":work:SOHCal.DB") then
MSGINFO("Sorry", "Did not work.")
endif
ViewName.open(":work:SOHCal.DB") ;displays the answer table

Endmethod

Reply With Quote
  #2  
Old   
Jeff Shoaf
 
Posts: n/a

Default Re: Sql Query - 01-03-2008 , 07:07 PM






Try this:

itemNameSQL.executeSql(db,":work:SOHCal.DB")

bspiteri (AT) ozemail (DOT) com.au wrote:
Quote:
I have used sql queries in paradox events previoisly and had no
problems, I now to use a new ODBC driver, the sql builder works fine.
I have tried to put the code on a button and now the sql query fails.
my code is as follows. Can anyone help me. It fails at the execute
statment.

var
itemNameSQL SQL
ViewName tableview
db database
tc1,tc2,tc3 Tcursor
cus,sup,prt,so,sod Longint
ar1 Array[] anytype
dynalias Dynarray[] anytype
endVar

tc1.open("Update Integers.db")
so = tc1.LastSalesOrder

dynalias["USER NAME"] = "XX"
dynalias["PASSWORD"] = "xxxxxx "

db.open (":Altro Caliach:", dynalias)

; this will open the connection to the local table or SQL table via
the alias

itemNameSQL = SQL ; the following stores the SQL statement
into the variable

SELECT Omnis_sohfile.SOHCADS, Omnis_adrfile.ADRID,
Omnis_sohfile.SOHSONO
Omnis_sohfile.SOHCREF, Omnis_sohfile.SOHDATE, Omnis_sohfile.SOHDAQO,
Omnis_sohfile.SOHCUSC,
Omnis_adrfile.ADRCNAM, Omnis_adrfile.ADRADDR, Omnis_adrfile.ADRZIP,
Omnis_adrfile.ADRTEL,
Omnis_sohfile.SOHQVAD
FROM OMNIS.ADRFILE Omnis_adrfile, OMNIS.SOHFILE Omnis_sohfile
WHERE (Omnis_sohfile.SOHCADS = Omnis_adrfile.ADRID)
and Omnis_sohfile.SOHSONO > '~so'

endsql


IF NOT executeSQL(db, itemNameSQL, ":work:SOHCal.DB") then
MSGINFO("Sorry", "Did not work.")
endif
ViewName.open(":work:SOHCal.DB") ;displays the answer table

Endmethod

Reply With Quote
Reply




Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.