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!

Accessing Index in SQL 7.0 Database from Visual Foxpro 6.0

Status
Not open for further replies.

dickylam

IS-IT--Management
Jun 24, 2001
86
Anybody can help me that I have a SQL database with many tables and index in the SQL 7.0 Server. And I want to use Visual Foxpro 6.0 to access the index. I create many remote views on each SQL tables in the database. But it seems stupid if I use locate command to find a record, and it is also impossible to perform re-index everytime I connect the table in remote view,

How to do that, please advise.
 
Hi,

You could use a SQLexec() function to send a SQL to the MSSQL back-end. If MSSQL has an index for the SQL, it would automatically use its index to return a cursor to VFP7. Of course the VFP cursor returned would be ordered according to the SQL and it would also match the back-end server index.

Leland F. Jackson, CPA
Software - Master (TM)
Nothing Runs Like the Fox
 
I have this an Oracle connection and Informix connection


I write this code.

PUBLIC nHandle, nHandle1,nHandle2,codcli,titulos

nHandle=SQLCONNECT('SFB', user, password) && ORACLE CONNECTION
nHandle2=SQLCONNECT('Informix_Cc',user, password) && INFORMIX CONNECTION

THE FIRST TWO NAMES ARE THE NAMES OF DE ODBC CONNECTION (SFB, INFORMIX_CC)


IN BOTH DATABASE I HAVE INDEX

TO SEARCH DATA I USE THIS CODE

codcli = THIS.VALUE
= SQLPREPARE(nHandle, 'SELECT * FROM sfb_bsmcl where sco_ident = ?codcli') && datos de clientes
= SQLEXEC(nHandle)


&& WHERE codcli is a data entry
?codcli the paramtere y pass to the table (this field is an index field)

THE RESULT IS IN A CURSOR WHERE YOU CAN GET ANY DATA LIKE A DBF
THIS IS VERY FAST


SORRY ABOUT MY ENGLISH

Pablo from argentina


 
Pablo,

Is the problem that the SQLEXEC takes a long time to return the data to your cursor?

Or are your trying to find a specific record in your returned cursor?

Simon
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top