How do I append using a odbc connection to a IBM iSeries database from a
foxpro table/cursor.

Aron

Re: SQL - APPEND by Anders

Anders
Tue Nov 30 18:23:33 CST 2004

Aron,

If you create an updatable, parameterized remote view that uses an ODBC
connection then you can
get a an cursor data set in VFP that represents the IBM table.
Add rows to this cursor using whatever VFP method you prefer. Then call
TABLEUPDATE(1, .T. 'myview' ) and the data will be written to the IBM table.
You can also use SQLPassThrough:
h = SQLCONNECT('ibm dsn')
USE vfptable
SCAN
SCATTER MEMVAR FIELDS col1, col2, col3
ns= SQLEXEC(h, [INSERT INTO IbmTable VALUES (?col1, ?col2, ?col3) ] )
IF ns= 1
* ok
ELSE
* not so good
ENDIF
ENDSCAN

-Anders

"Aron" <Aron@discussions.microsoft.com> wrote in message
news:46CCA546-02B4-4B25-8B56-13849415BA9D@microsoft.com...
> How do I append using a odbc connection to a IBM iSeries database from a
> foxpro table/cursor.
>
> Aron


Re: SQL - APPEND by Aron

Aron
Wed Dec 01 08:51:01 CST 2004

I created a remote view using the database designer, I could open the table I
use the APPEND FROM command to append the records and TABLEUPDATE command to
save changes however once I close the remote view the data is lost.

Thanks for your help
Aron

"Anders Altberg" wrote:

> Aron,
>
> If you create an updatable, parameterized remote view that uses an ODBC
> connection then you can
> get a an cursor data set in VFP that represents the IBM table.
> Add rows to this cursor using whatever VFP method you prefer. Then call
> TABLEUPDATE(1, .T. 'myview' ) and the data will be written to the IBM table.
> You can also use SQLPassThrough:
> h = SQLCONNECT('ibm dsn')
> USE vfptable
> SCAN
> SCATTER MEMVAR FIELDS col1, col2, col3
> ns= SQLEXEC(h, [INSERT INTO IbmTable VALUES (?col1, ?col2, ?col3) ] )
> IF ns= 1
> * ok
> ELSE
> * not so good
> ENDIF
> ENDSCAN
>
> -Anders
>
> "Aron" <Aron@discussions.microsoft.com> wrote in message
> news:46CCA546-02B4-4B25-8B56-13849415BA9D@microsoft.com...
> > How do I append using a odbc connection to a IBM iSeries database from a
> > foxpro table/cursor.
> >
> > Aron
>
>

Re: SQL - APPEND by tom

tom
Tue Dec 07 05:11:19 CST 2004

Hi Aaron,

check the propertys of your view, exspecially if you have defined the key
fields / updatable fields and exspecially the little checkmark "send sql
updates" :-)

Also try to set the propertys of the connection to exclusive on (just for
testing)

HTH
Tom


"Aron" <Aron@discussions.microsoft.com> schrieb im Newsbeitrag
news:6BA6B6A1-F9A5-473B-978C-4E97D3E6EC8D@microsoft.com...
> I created a remote view using the database designer, I could open the
table I
> use the APPEND FROM command to append the records and TABLEUPDATE command
to
> save changes however once I close the remote view the data is lost.
>
> Thanks for your help
> Aron