Board index » delphi » Still Looking!!! ADO Insert causes Invalid Variant Type Conversion error.
jlori...@hotpop.com (Jessica Loriena)
![]() Delphi Developer |
Fri, 05 Nov 2004 14:19:05 GMT
|
jlori...@hotpop.com (Jessica Loriena)
![]() Delphi Developer |
Fri, 05 Nov 2004 14:19:05 GMT
Still Looking!!! ADO Insert causes Invalid Variant Type Conversion error.
I have a simple master-detail tables structure with ADO: ORDER and
ITEMS. I can browse through the data without a problem, but when I issue the What am I doing wrong here??? The detail table (ITEMS) have the MasterSource: ORDER I'm using SQL Server 2000 on Win2K and ID (master ORDER table) is an I read about Variant Type to NULL conversion problems, and maybe it's TIA for your urgent replies!!! Jessica |
Menno Avegaar
![]() Delphi Developer |
Tue, 09 Nov 2004 03:44:43 GMT
Re:Still Looking!!! ADO Insert causes Invalid Variant Type Conversion error.When you put the ORDER table into insert mode the detail table will try to display the items for ID field in the master table. In a new record this ID field is probably NULL. To avoid this you could set ID to an unused value (e.g. -1) in the OnNewRecord event of the master table. "Jessica Loriena" <jlori...@hotpop.com> schreef in bericht Quote> I have a simple master-detail tables structure with ADO: ORDER and |
Jessica Lorie
![]() Delphi Developer |
Fri, 19 Nov 2004 13:48:09 GMT
Re:Still Looking!!! ADO Insert causes Invalid Variant Type Conversion error.In my case, the Master ID field is an "identity" (auto-number) field which results in a "Field ID cannot be modified" error message. This is really starting to annoy me. Is it so complicated to do a Can ANYONE point out a solution to this?? Is this impossible to do Jessica Quote"Menno Avegaart" <avega...@NOSPAMwanadoo.nl> wrote in message <news:acjd0n$1a2a$1@scavenger.euro.net>... |
Menno Avegaar
![]() Delphi Developer |
Sat, 20 Nov 2004 04:06:02 GMT
Re:Still Looking!!! ADO Insert causes Invalid Variant Type Conversion error.In that case you'll have to use local caching of the detail table (with the TClientDataset component). Instead of displaying the detail table you copy the data to the TClientDataset. Any modifications to the TClientDataset can be stored AFTER the master dataset is posted. "Jessica Loriena" <jlori...@hotpop.com> schreef in bericht Quote> In my case, the Master ID field is an "identity" (auto-number) field - Hide quoted text - - Show quoted text - Quote> > When you put the ORDER table into insert mode the detail table will try |
Jessica Lorie
![]() Delphi Developer |
Mon, 22 Nov 2004 13:45:58 GMT
Re:Still Looking!!! ADO Insert causes Invalid Variant Type Conversion error.Quote> In that case you'll have to use local caching of the detail table (with the Jessica Quote"Menno Avegaart" <avega...@NOSPAMwanadoo.nl> wrote in message <news:adgec3$180r$1@scavenger.euro.net>... |
Kai Inge Buset
![]() Delphi Developer |
Tue, 23 Nov 2004 04:32:59 GMT
Re:Still Looking!!! ADO Insert causes Invalid Variant Type Conversion error.Hello Jessica, I deal a lot with master detail tables, though using dBase tables. I must say that I never have tried the ADO as I'm told it's a slower :) Jessica Loriena <jlori...@hotpop.com> skrev i Quote> > In that case you'll have to use local caching of the detail table (with Quote> > In that case you'll have to use local caching of the detail table (with |
Andy
![]() Delphi Developer |
Wed, 08 Dec 2004 00:58:42 GMT
Re:Still Looking!!! ADO Insert causes Invalid Variant Type Conversion error.Jessica, It really has nothing to do with Delphi, basic RDBMS theory prohibits what you say you want to do, you MUST have a master table ID to use in the detail record. You will have to create and post the master first in order to get it's ID. If your DBMS supports transaction processing , I believe you could do this in the transaction and roll it back if the operation is abandoned. Or you could use memory tables for the insert edit and then copy the records to your db... Quote"Jessica Loriena" <jlori...@hotpop.com> wrote in message Quote> In my case, the Master ID field is an "identity" (auto-number) field - Hide quoted text - - Show quoted text - Quote> > When you put the ORDER table into insert mode the detail table will try |
Dan Brenna
![]() Delphi Developer |
Wed, 08 Dec 2004 02:04:04 GMT
Re:Still Looking!!! ADO Insert causes Invalid Variant Type Conversion error.Here is an alternate way to approach this. The auto-number field is at the root of the problem. Don't use it. Use a regular long integer field and supply your own id numbers. That way you know the number at the start and won't have to post the master record in order to find out what the id will be. 1. Create a small table [IDno] to hold the current value of the master 2. Add a function "GetNextID" which will open the IDno table in 3. Now your code for the data entry form can build all of the update 4. If the operator cancels the whole operation after starting, you HTH, On 2 Jun 2002 22:48:09 -0700, jlori...@hotpop.com (Jessica Loriena) Quote>In my case, the Master ID field is an "identity" (auto-number) field |
1. ADO Insert causes Invalid Variant Type Conversion error
2. ADO Insert causes Invalid Variant Type Conversion error
3. Invalid variant type conversion - ADO and Delphi
4. Invalid variant type conversion error
5. Help: Invalid Variant Type Conversion Error
6. ADOTable open - error: Invalid variant type conversion.
7. Invalid Variant Type Conversion Error - This is where it stops
8. Invalid Variant Type conversion error