Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
A simple ADO question (I think)
Message
 
À
27/11/1999 19:41:43
Information générale
Forum:
Visual FoxPro
Catégorie:
Client/serveur
Divers
Thread ID:
00295882
Message ID:
00296068
Vues:
26
Hi Malclom...

I am guessing at this point that you are using VFP data, not SQL-Server data. So, my suggestion here will center around using the recordset object.

The best way to achieve what you are looking for is to issue a SQL statement like this:

SELECT * FROM Involice WHERE Invoice_ID = -1

Then, in your resulting recordset, you can invoke the AddNew Method to get a blank record

HTH...



>Erik:
>Thank you for you prompt reply.
>To explain further, I want to create a new invoice record. All I really need is a row (APPEND BLANK type of a row) to populate with the new Invoice information - create a new invoice.
>
>I do a ...
>SELECT * FROM Involice WHERE Invoice_ID = 9999
>9999 does not exist at this point so the SQL Statement returns a blank recordset (I'm also guessing that somewhere in ADO, there's a error message waiting to be discovered). Then I do an ADDNEW to create a blank row and populate it with the new information.
>
>My concern is that it just doesn't seem right to use WHERE Invocie_ID = 9999 becuase eventually 9999 will actually exist. Then what, do I use 99999? It just seems forced; not flowing; not proper; MAKE-SHIFT.
>
>I guess my question is: How do I get a blank recordset with only 1 blank row the proper way?
>
>Again, thank you
>
>Mal
>
>>>I've been experimenting with ADO (using OLE DB) for a couple of months now. It works great, as far as I'm concerned. However, I can't seem to figure out the equivalent of APPEND BLANK. Presently, I send a SQL Statement to retrieve a record that does not exists. It returns a NULL RecordSet then I do a ADDNEW. This works, however, I'm worried because it's "make-shift" and will come back to haunt me. Can anyone tell me what the correct way of handling this is.
>>>
>>>Mal
>>
>>I think that the AddNew method is the generally accepted method... what are you worried?
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform