Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Upsizing GUID to UniqueIdentifier
Message
De
15/09/2005 08:20:03
Cetin Basoz
Engineerica Inc.
Izmir, Turquie
 
 
À
14/09/2005 18:43:04
Information générale
Forum:
Visual FoxPro
Catégorie:
Client/serveur
Divers
Thread ID:
01049183
Message ID:
01049794
Vues:
46
This message has been marked as the solution to the initial question of the thread.
c(36) and c(38) versions are not binary (nocptrans). They're plain char fields and directly convertible to uniqueidentifier.
PS: I see DBTYPE_BYTES there. It matches VFP9 VFPOLEDB specicification and would directly convert to DBTYPE_GUID if it were c(16) nocptrans version. At home I had old VFPOLEDB (VFP7)that maps c(16) binary to DBTYPE_STR and I had to use varbinary first). When it's DBTYPE_BYTES a GUID is exactly 16 bytes (16*8=128 bits value).

Nope it doesn't convert directly and I get conversion error as you said (DTS bug IMHO). To workaround:

From Transform (...) go to "Transformations" tab. Select "Transform ...." and edit VB script there:

Under "Function Main()" line add this line:
TransformFlags = DTSTransformFlag_ForceConvert
Cetin

>Okay, this is not the result I am getting so I may have something set wrong in my DTS.
>
>I have the c(38) nocptrans field. I run the DTS wizard. I pick uniqueid for that field.
>
>I run the DTS and I get this error:
>
>DTSTransformCopy: Schema validation failed. See extended error information.
>TransformCopy 'DirectCopyXForm' validation error: ForceConvert not specified but
>required for column pair 13 (source column 'pk_supplier'
>(DBTYPE_BYTES),destination column 'pk_supplier' (DBTYPE_GUID)
>
>Any idea how to specify ForceConvert ?
>
>>Charles,
>>I didn't have VFP and SQL server on this box so it took me sometime to install them and test:)
>>I created a database in VFP with 3 tables in it. Those 3 tables had c(38),c(36) and c(16) nocptrans versions respectively.
>>In SQL server DTS I directly mapped 36,38 ones to uniqueidentifier and 16 bytes one to varbinary(16). All imported sucessfully. After import I changed type of 3rd one to uniqueidentifier.
>>Checked values in both VFP and SQL server and they matched.
>>Cetin
>>
>>>>I think we're losing to be synch in "upsizing".
>>>
>>>Yani, "out of synch" (free English lesson in return for code lesson :-)
>>>
>>>Okay, I think I am starting to get what you are saying. ( still don't understand pguid and rguid as you use them but maybe I don't have to in order to use the function. ) I did understand we were talking about using code on the VFP side to 'upsize' and not to use the wizard.
>>>
>>>I did try converting the c(36) guids to c(38) including the brackets. If I do that the DTS transformation allows me to select UniqueID as the destination data type, but the import fails saying that a forcedconversion is required and I can't find out how to do that. ( will go back and try again on the DTS wizard )
>>>
>>>Let me play some more and I will come back with more questions.
>>>
Çetin Basöz

The way to Go
Flutter - For mobile, web and desktop.
World's most advanced open source relational database.
.Net for foxheads - Blog (main)
FoxSharp - Blog (mirror)
Welcome to FoxyClasses

LinqPad - C#,VB,F#,SQL,eSQL ... scratchpad
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform