Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
A simple ADO question (I think)
Message
De
27/11/1999 23:10:23
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Client/serveur
Divers
Thread ID:
00295882
Message ID:
00296097
Vues:
24
John!!
Yes!! -1 <- didn't think of using that. The invoice will never (well, never say never, I should say, "should never") be a -1. Thank you.

By the way, I am using SQL SERVER 7.0 and not VFP data. Will it be different with SQL SERVER?

Again, thank you.

Mal


>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
Répondre
Fil
Voir

Click here to load this message in the networking platform