I'm doing conversion from vfp to MSSQL database. When i get my hand dirty yesterday changing a screen, i'm really worry whether am i doing it a right way although it's functionally works.
Because this scrren i was doing has nagivation buttons (Top,Prev,Next,Last), I decided to select the whole table (2000 records max) using SPT into a cursor, CurCustomer.
In the nagivation buttons, i point it to this Cuscustomer
as i was pointing it to a VFP table.
Example:
The way i did my existing system consists the following steps :
From (Fox Table)
SELECT Customer
IF NOT EOF()
skip
ENDIF
What i doing now is for MSSQL :
(In the Form Init())
nConnection = SQLCONNECT()
SQLEXEC(nConnection, "Select * from Customer", "CurCustomer")
SELECT CurCustomer
SQLDISCONNECT(nConnection)
(In the Form NEXT button Click())
SELECT CurCustomer
IF NOT EOF()
skip
ENDIF
This reason i do this is it requires less rewrite of codes therefore, the core logic will not be heavily touched which might result more chances for bugs as the current system is quite stable.
Am i doing a right thing here ? Any advice will be much appreciated.
Thanks.
Because this scrren i was doing has nagivation buttons (Top,Prev,Next,Last), I decided to select the whole table (2000 records max) using SPT into a cursor, CurCustomer.
In the nagivation buttons, i point it to this Cuscustomer
as i was pointing it to a VFP table.
Example:
The way i did my existing system consists the following steps :
From (Fox Table)
SELECT Customer
IF NOT EOF()
skip
ENDIF
What i doing now is for MSSQL :
(In the Form Init())
nConnection = SQLCONNECT()
SQLEXEC(nConnection, "Select * from Customer", "CurCustomer")
SELECT CurCustomer
SQLDISCONNECT(nConnection)
(In the Form NEXT button Click())
SELECT CurCustomer
IF NOT EOF()
skip
ENDIF
This reason i do this is it requires less rewrite of codes therefore, the core logic will not be heavily touched which might result more chances for bugs as the current system is quite stable.
Am i doing a right thing here ? Any advice will be much appreciated.
Thanks.