Not satisfied with the code !! 
Author Message
 Not satisfied with the code !!

I am not satisfied with this

  Select * FROM .\DATA\trykk_kalk.DBF WHERE trykk_kalk.typenummer =
ALLTRIM(lckalkylenr) INTO CURSOR ttkalkyle

The reasen is that this statement always move the cursor to the end of the
table and the only thing i want to do is to pick only one record from the
table and put that record in a cursor.
(Later i make a XML statement of that cursor).

I want to do this ?:
select trykk_kalk
set order to kalkylenr
seek lckalkylenr

But now the 1000dollar question.
How do i make a cursor of only that post without using my first statement
(select * from....)

Yours
Lasse



Sun, 09 Mar 2003 03:00:00 GMT  
 Not satisfied with the code !!

You can try to create a cursor and use scatter and gather here

Greetings,

Ko wisse



Sun, 09 Mar 2003 03:00:00 GMT  
 Not satisfied with the code !!


Quote:

> You can try to create a cursor and use scatter and gather here

Yes Ko
But I have never done that...
When i Create the cursor do I use Create Cursor
What about the memo fields.
Any problems here?


Sun, 09 Mar 2003 03:00:00 GMT  
 Not satisfied with the code !!

The MEMO clause in the scatter command takes care of memo fields:

USE MyTable
LOCATE FOR MyCondition = 'MyValue'
SCATTER MEMVAR MEMO
=AFIELDS(aStructure)
CREATE CURSOR crsTemp FROM ARRAY aStructure
SELECT crsTemp
INSERT INTO crsTemp FROM MEMVAR



Quote:



> > You can try to create a cursor and use scatter and gather here

> Yes Ko
> But I have never done that...
> When i Create the cursor do I use Create Cursor
> What about the memo fields.
> Any problems here?



Sun, 09 Mar 2003 03:00:00 GMT  
 Not satisfied with the code !!
You can try this.

Select MyTable
AFIELDS(laMyArray)
Scatter Memo MemVar
Create Cursor MyTempCursor From Array laMyArray
Append Blank
Gather Memo MemVar

The creating of the cursor you only need once.

Hope this helps you,

Ko Wisse



Sun, 09 Mar 2003 03:00:00 GMT  
 Not satisfied with the code !!

Add COPY TO ... to your code, as shown below.

 - Rush


Quote:
> I am not satisfied with this

>   Select * FROM .\DATA\trykk_kalk.DBF WHERE trykk_kalk.typenummer =
> ALLTRIM(lckalkylenr) INTO CURSOR ttkalkyle

> The reasen is that this statement always move the cursor to the end of the
> table and the only thing i want to do is to pick only one record from the
> table and put that record in a cursor.
> (Later i make a XML statement of that cursor).

> I want to do this ?:
> select trykk_kalk
> set order to kalkylenr
> seek lckalkylenr

COPY TO TempFile RECORD RECNO()


Sun, 09 Mar 2003 03:00:00 GMT  
 Not satisfied with the code !!
Thank you again - all of you.
I could not done it without you...


Sun, 09 Mar 2003 03:00:00 GMT  
 Not satisfied with the code !!
Why make a cursor?  You are on top of the record in question with your
seek().  So just do your XML from there.

__Stephen


Quote:
> I am not satisfied with this

>   Select * FROM .\DATA\trykk_kalk.DBF WHERE trykk_kalk.typenummer =
> ALLTRIM(lckalkylenr) INTO CURSOR ttkalkyle

> The reasen is that this statement always move the cursor to the end of the
> table and the only thing i want to do is to pick only one record from the
> table and put that record in a cursor.
> (Later i make a XML statement of that cursor).

> I want to do this ?:
> select trykk_kalk
> set order to kalkylenr
> seek lckalkylenr

> But now the 1000dollar question.
> How do i make a cursor of only that post without using my first statement
> (select * from....)

> Yours
> Lasse



Sun, 09 Mar 2003 03:00:00 GMT  
 Not satisfied with the code !!


Quote:
> I am not satisfied with this

>   Select * FROM .\DATA\trykk_kalk.DBF WHERE trykk_kalk.typenummer =
> ALLTRIM(lckalkylenr) INTO CURSOR ttkalkyle

> The reasen is that this statement always move the cursor to the end of the
> table and the only thing i want to do is to pick only one record from the
> table and put that record in a cursor.

Hej Lasse
That's curious. SQL SELECT does NOT move the record pointer of an open file.
If the dbf isn't open when you do a SELECT it will be opened and left open
and the record pointer will likely be on the top row but that's another
story. If your table Tryck_kalk is included in the database it should not be
adressed with path\name - the database will know where to look.

-Anders



Mon, 10 Mar 2003 03:00:00 GMT  
 
 [ 9 post ] 

 Relevant Pages 

1. OLE error code:0x80040154 Class not registered

2. OLE error code 0x80040112: Appropriate license for this class not found

3. Code window font settings not saved...

4. Source code not available

5. Fixing 'Not a DBF' source code

6. bar code not printing in distibution copy from foxpro 5.0a

7. Customer display is not executing the code

8. OLE error code 0x80040112:Appropriate license not found

9. vfp7 not saving my classes click codes???

10. Setting code page from inside a program not dialog box

11. OLE error code 0x80040154: Class not registered

12. function not implemented error (error code 1999)

 

 
Powered by phpBB® Forum Software