Information générale
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
Titre:
Default Primary key on append
Versions des environnements
Ok guys sorry about this one I'm sure it's been done over before but it's now late, I've searched hard and I cant figure it out.
I had my application on a local database, in that database I have a stored procedure for getting each tables next Primary key, this I put in the default value for the primary key fields of said tables.
so putting say append blank, gives me a nice new record with the primary key set all ready.
now I want to access this database from a remote view, I have another application with a fresh local database, and this database has remote views to database number one.
I now wish to add a record to one of the tables in database 1 from application 2 more specifically the table pointed at by my remote view.
it does not issue the default value, I cannot seem to call the routine through a sqlexec() I've tried putting all the append code into a stored procedure so I just pass a table name but again that fails (is it because I'm not returning records? it's not actually adding a record either way)
Whats the best way of doing this guys? I was thinking about getting a view to the key table and copying the stored procedures accross so I will create it all from the client end and then send the new record with primary key, this seems mad though. it also means I need to make the primary key field modifiable on the remote view end which I didn't really want.
There must be a good way of doing this, a pointer to a website may be enough, oh and just a reminder, I'm using VFP6 so the auto primary key thingies in 7 or 8 or whenever they were added are not there for me, I call for vfp9 but you know what it's like when it comes to upgraqde time.
Ken.
Suivant
Répondre
Voir le fil de ce thread
Voir le fil de ce thread à partir de ce message seulement
Voir tous les messages de ce thread
Voir tous les messages de ce thread à partir de ce message seulement