beanbrain
Programmer
- Dec 31, 2001
- 170
I am using both Paradox 7.0 and Paradox 10.0 on a Windows NT 4.0 network. Lately I was asked to provide data to Sybase Adaptive Server AS 12.5. I perform this connection via an ODBC link which Paradox sees as an alias.
The problem is Paradox 7.0 runs this beautifully without error and Paradox 10.0 cannot.
Typically I get "An error was triggered in the executeSQL method on an object of SQL type." This is followed by "Parameter not set in query string." These two errors occur right at the executeSQL statement.
Of course I need this to run in Paradox 10 along with all the other automated processes that have been created.
Here is the script code that is executed. Note that the SQL calls are stored as SQL statements in Paradox.
[tt]
method run(var eventInfo Event)
var
q Query
s String
ar Array[] String
tbl Table
tc tCursor
dDb, myDb Database
s1 SQL
dbParmsDA DynArray[] AnyType
firstSes,
secondSes Session
endVar
disablePreviousError(Yes)
errorClear()
message("Updating SPersonnel"
tbl.attach(":busoff:SPersonnel"
if not tbl.empty() then
message("Unable to empty SPersonnel table."
return
endIf
tbl.unAttach()
q = Query
ANSWER: RIV:ANSWER.DB
SPersonnel.db | Last Name | First Name | SSN | Employee ID |
Insert | _join1 | _join2 | _join3 | _join4 |
SPersonnel.db | ISI Employment Start Date | ISI Employment End Date | Email |
| _join5 | _join6 | _join8 |
SPersonnel.db | Supervisor | Division Number | Staff Category |
| _join7 | _join9 | _join10 |
SPersonnel.db | Visitor Number |
| blank |
ersonnel:Entity.db | EmplNo | FirstName |
| _join4, not X.., not N.., not V.. | _join2 |
ersonnel:Entity.db | LastName | EmpStart | EmpTerm |
| _join1 | _join5 | _join6, blank or >=7/1/2002 |
ersonnel:Entity.db | SSN | StaffCat | Division | PrjLdr | Email |
| _join3 | _join10 | _join9 | _join7 | _join8 |
EndQuery
if not q.executeQBE() then
message("Unable to insert Records to SPersonnel."
return
endIf
q = Query
ANSWER: RIV:ANSWER.DB
SPersonnel.db | Last Name | First Name | SSN | Employee ID |
Insert | _join1 | _join2 | _join3 | blank |
SPersonnel.db | ISI Employment Start Date | ISI Employment End Date | Email |
| _join5 | _join6 | _join8 |
SPersonnel.db | Supervisor | Division Number | Staff Category |
| _join7 | _join9 | _join10 |
SPersonnel.db | Visitor Number |
| _join4 |
ersonnel:Entity.db | EmplNo | FirstName |
| _join4, V.., not X.., not N.. | _join2 |
ersonnel:Entity.db | LastName | EmpStart | EmpTerm |
| _join1 | _join5 | _join6, blank or >=7/1/2002 |
ersonnel:Entity.db | SSN | StaffCat | Division | PrjLdr | Email |
| _join3 | _join10 | _join9 | _join7 | _join8 |
EndQuery
if not q.executeQBE() then
message("Unable to insert Records to SPersonnel."
return
endIf
message("Updating SAccount"
tbl.attach(":busoff:SAccount"
if not tbl.empty() then
message("Unable to empty SAccount table."
return
endIf
tbl.unAttach()
; populate the intermediate table for Accounts
q = Query
ANSWER: RIV:ANSWER.DB
SAccount.DB | Account Number | Account Name | Burden Center | Award Number |
Insert | _join1 | _join2 | _join3 | _join4 |
SAccount.DB | Account Status ID | Account Start Date | Account End Date |
| _join5 | _join6 | _join7 |
SAccount.DB | Account Manager |
| _join8 |
:Contract:Chart.DB | AcctNo | AcctName | Location | StrtDate |
| _join1 | _join2 | _join3 | _join6 |
:Contract:Chart.DB | EndDate | ProjLdr | AwardNo | AcctStatus |
| _join7, >6/30/2002 | _join8 | _join4 | _join5 |
EndQuery
if not q.executeQBE() then
message("Unable to insert Records to SAccount."
return
endIf
; using tCursor scan SAccount for multiple ProjMgr names in field and truncate at "/".
message("Reducing Project Manager name."
tc.open(":busoff:SAccount.db"
tc.edit()
scan tc :
s = tc."Account Manager"
s.breakApart(ar,"/"
tc."Account Manager" = ar[1]
endScan
tc.endEdit()
tc.close()
if not exportASCIIVar ( "SPersonnel.db", "SPersonnel.txt", ",", "\"", False, True ) then
message("Error Export","Unable to Export SPersonnel.txt."
return
endIf
if not exportASCIIVar ( "SAccount.db", "SAccount.txt", ",", "\"", False, True ) then
message("Error Exporting","Unable to Export SAccount.txt."
return
endIf
message("Writing to SyBase P_Account."
removeAllPasswords()
firstSes.open()
;firstSes.addPassword("Paradox"
dbParmsDA["OPEN MODE"] = "READ/WRITE"
dbParmsDA["Password"] = "Paradox"
dbParmsDA["SQLPASSTHRU"] = "SHARED AUTOCOMMIT"
if not dDb.open(":bo_personnel:",firstSes, dbParmsDA) then ; (remote is an alias defined elsewhere)
message("Unable to connect to :bo_personnel: database."
return
endIf
message("Writing to SQL SyBase P_Personnel."
s1.readFromFile("SPersonnel.sql"
if not executeSQL(dDb, s1) then
message("Unable to run SPersonnel SQL query."
firstSes.close()
return
endIf
message("Writing to SQL SyBase P_Account."
s1.readFromFile("SAccount.sql"
if not executeSQL(dDb, s1) then
message("Unable to run SAccount SQL query."
firstSes.close()
return
endIf
dDb.close()
message("Done..."
exit()
tc.open("LastMsgDate.db"
tc.edit()
tc."LastDirUpdateDate" = today()
tc.endEdit()
tc.close()
endMethod
[/tt]
Finally I can also post the SQL statements called above if this is helpful.
Thanks in advance for any help you can provide.
The problem is Paradox 7.0 runs this beautifully without error and Paradox 10.0 cannot.
Typically I get "An error was triggered in the executeSQL method on an object of SQL type." This is followed by "Parameter not set in query string." These two errors occur right at the executeSQL statement.
Of course I need this to run in Paradox 10 along with all the other automated processes that have been created.
Here is the script code that is executed. Note that the SQL calls are stored as SQL statements in Paradox.
[tt]
method run(var eventInfo Event)
var
q Query
s String
ar Array[] String
tbl Table
tc tCursor
dDb, myDb Database
s1 SQL
dbParmsDA DynArray[] AnyType
firstSes,
secondSes Session
endVar
disablePreviousError(Yes)
errorClear()
message("Updating SPersonnel"
tbl.attach(":busoff:SPersonnel"
if not tbl.empty() then
message("Unable to empty SPersonnel table."
return
endIf
tbl.unAttach()
q = Query
ANSWER: RIV:ANSWER.DB
SPersonnel.db | Last Name | First Name | SSN | Employee ID |
Insert | _join1 | _join2 | _join3 | _join4 |
SPersonnel.db | ISI Employment Start Date | ISI Employment End Date | Email |
| _join5 | _join6 | _join8 |
SPersonnel.db | Supervisor | Division Number | Staff Category |
| _join7 | _join9 | _join10 |
SPersonnel.db | Visitor Number |
| blank |
ersonnel:Entity.db | EmplNo | FirstName |
| _join4, not X.., not N.., not V.. | _join2 |
ersonnel:Entity.db | LastName | EmpStart | EmpTerm |
| _join1 | _join5 | _join6, blank or >=7/1/2002 |
ersonnel:Entity.db | SSN | StaffCat | Division | PrjLdr | Email |
| _join3 | _join10 | _join9 | _join7 | _join8 |
EndQuery
if not q.executeQBE() then
message("Unable to insert Records to SPersonnel."
return
endIf
q = Query
ANSWER: RIV:ANSWER.DB
SPersonnel.db | Last Name | First Name | SSN | Employee ID |
Insert | _join1 | _join2 | _join3 | blank |
SPersonnel.db | ISI Employment Start Date | ISI Employment End Date | Email |
| _join5 | _join6 | _join8 |
SPersonnel.db | Supervisor | Division Number | Staff Category |
| _join7 | _join9 | _join10 |
SPersonnel.db | Visitor Number |
| _join4 |
ersonnel:Entity.db | EmplNo | FirstName |
| _join4, V.., not X.., not N.. | _join2 |
ersonnel:Entity.db | LastName | EmpStart | EmpTerm |
| _join1 | _join5 | _join6, blank or >=7/1/2002 |
ersonnel:Entity.db | SSN | StaffCat | Division | PrjLdr | Email |
| _join3 | _join10 | _join9 | _join7 | _join8 |
EndQuery
if not q.executeQBE() then
message("Unable to insert Records to SPersonnel."
return
endIf
message("Updating SAccount"
tbl.attach(":busoff:SAccount"
if not tbl.empty() then
message("Unable to empty SAccount table."
return
endIf
tbl.unAttach()
; populate the intermediate table for Accounts
q = Query
ANSWER: RIV:ANSWER.DB
SAccount.DB | Account Number | Account Name | Burden Center | Award Number |
Insert | _join1 | _join2 | _join3 | _join4 |
SAccount.DB | Account Status ID | Account Start Date | Account End Date |
| _join5 | _join6 | _join7 |
SAccount.DB | Account Manager |
| _join8 |
:Contract:Chart.DB | AcctNo | AcctName | Location | StrtDate |
| _join1 | _join2 | _join3 | _join6 |
:Contract:Chart.DB | EndDate | ProjLdr | AwardNo | AcctStatus |
| _join7, >6/30/2002 | _join8 | _join4 | _join5 |
EndQuery
if not q.executeQBE() then
message("Unable to insert Records to SAccount."
return
endIf
; using tCursor scan SAccount for multiple ProjMgr names in field and truncate at "/".
message("Reducing Project Manager name."
tc.open(":busoff:SAccount.db"
tc.edit()
scan tc :
s = tc."Account Manager"
s.breakApart(ar,"/"
tc."Account Manager" = ar[1]
endScan
tc.endEdit()
tc.close()
if not exportASCIIVar ( "SPersonnel.db", "SPersonnel.txt", ",", "\"", False, True ) then
message("Error Export","Unable to Export SPersonnel.txt."
return
endIf
if not exportASCIIVar ( "SAccount.db", "SAccount.txt", ",", "\"", False, True ) then
message("Error Exporting","Unable to Export SAccount.txt."
return
endIf
message("Writing to SyBase P_Account."
removeAllPasswords()
firstSes.open()
;firstSes.addPassword("Paradox"
dbParmsDA["OPEN MODE"] = "READ/WRITE"
dbParmsDA["Password"] = "Paradox"
dbParmsDA["SQLPASSTHRU"] = "SHARED AUTOCOMMIT"
if not dDb.open(":bo_personnel:",firstSes, dbParmsDA) then ; (remote is an alias defined elsewhere)
message("Unable to connect to :bo_personnel: database."
return
endIf
message("Writing to SQL SyBase P_Personnel."
s1.readFromFile("SPersonnel.sql"
if not executeSQL(dDb, s1) then
message("Unable to run SPersonnel SQL query."
firstSes.close()
return
endIf
message("Writing to SQL SyBase P_Account."
s1.readFromFile("SAccount.sql"
if not executeSQL(dDb, s1) then
message("Unable to run SAccount SQL query."
firstSes.close()
return
endIf
dDb.close()
message("Done..."
exit()
tc.open("LastMsgDate.db"
tc.edit()
tc."LastDirUpdateDate" = today()
tc.endEdit()
tc.close()
endMethod
[/tt]
Finally I can also post the SQL statements called above if this is helpful.
Thanks in advance for any help you can provide.