Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion Groups
Database Servers
DB2InformixIngresMS SQLOraclePervasive.SQLPostgreSQLProgressSybase
Desktop Databases
FileMakerFoxProMS AccessParadox
General
General DB TopicsDatabase Theory
Related Topics
Java Development.NET DevelopmentVB DevelopmentMore Topics ...

Database Forum / FoxPro / General FoxPro Topics / October 2008

Tip: Looking for answers? Try searching our database.

GUID values in VFP 8

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Greg de Bruin - 06 Oct 2008 18:58 GMT
I'm working with a table in Access that contains GUID values in certain
fields.  I am pulling the data into a VFP table that has the field defined
as Character.  Later, when I go into Access, I try to join the original
Access table to the VFP table, via the GUID field.  The problem is that VFP
has stripped the braces from the front and back of the GUID value, making it
not match the original.

When I created the field in VFP, using Create Table, I called it a character
type, 38 characters long.  Is this correct or do GUID values get called
something else?  How can I maintain the original value of a GUID field?

Greg
Rush Strong - 06 Oct 2008 20:27 GMT
> I'm working with a table in Access that contains GUID values in certain
> fields.  I am pulling the data into a VFP table that has the field defined
[quoted text clipped - 8 lines]
>
> Greg

How are you populating the fields?  Fox is not in the habit of
stripping braces.  Is it possible that Access is exporting the
values sans braces?

(The braces aren't actually part of the GUID, they are just
formatting items).

 - Rush
Greg de Bruin - 06 Oct 2008 21:51 GMT
I have a remote view to several Access tables, one of which has the GUID
field I'm interested in.  My program actually creates a local Cursor and
I've defined the GUID field in the cursor as Character(38).  I then scan
through the remote view, SCATTER MEMVAR, make some calculations, and then
INSERT FROM MEMVAR into my cursor.  Eventually, the cursor is written to a
free table, which is what I am trying to read from Access.  I don't actually
do any operations on the GUID field, except that I am telling it to dump to
a character field in my cursor.

>> I'm working with a table in Access that contains GUID values in certain
>> fields.  I am pulling the data into a VFP table that has the field
[quoted text clipped - 17 lines]
>
>  - Rush
Rush Strong - 06 Oct 2008 22:15 GMT
What do you see in the GUID fields if you BROWSE the remote view?

 - Rush

> I have a remote view to several Access tables, one of which has the GUID
> field I'm interested in.  My program actually creates a local Cursor and
[quoted text clipped - 25 lines]
>>
>>  - Rush
Greg de Bruin - 07 Oct 2008 04:29 GMT
It looks the same as the VFP table - no braces at the ends but the hyphens
do show up in the middle.  If I view the data in Access, I see the
surrounding braces in the native Access table..

> What do you see in the GUID fields if you BROWSE the remote view?
>
[quoted text clipped - 29 lines]
>>>
>>>  - Rush
Rush Strong - 07 Oct 2008 04:58 GMT
What is the data type in the Access table?  A GUID is simply a
number, which is commonly represented by a string of hex digits,
with or without the braces.  If the GUID is stored as a value in
Access, then converted to an ASCII string in your remote view, then
the Access value won't match the Fox string.

Can you post the relevant code for the view?

 - Rush

> It looks the same as the VFP table - no braces at the ends but the hyphens
> do show up in the middle.  If I view the data in Access, I see the
[quoted text clipped - 33 lines]
>>>>
>>>>  - Rush
Greg de Bruin - 07 Oct 2008 13:45 GMT
Good idea on examining the view.  Why didn't I think of that?  The field is
a character but it's only 36 long, not 38.  That must have some
significance.

DBSetProp(ThisView+".gid","Field","DataType","C(36)")
DBSetProp(ThisView+".gid","Field","UpdateName","Houses.GID")
DBSetProp(ThisView+".gid","Field","KeyField",.T.)
DBSetProp(ThisView+".gid","Field","Updatable",.F.)

I'll try just widening it to 38 and see if that changes anything.

> What is the data type in the Access table?  A GUID is simply a number,
> which is commonly represented by a string of hex digits, with or without
[quoted text clipped - 45 lines]
>>>>>
>>>>>  - Rush
Olaf Doschke - 07 Oct 2008 14:29 GMT
> DBSetProp(ThisView+".gid","Field","DataType","C(36)")
> I'll try just widening it to 38 and see if that changes anything.
Do that.

With SQL Server it works with C(36) fields, as
SQL server also accepts such queries:

select * from sometable where
uniqueidfield = 'dec2868a-1234-abcd-4321-0f59abcd96ff'

You may be successful by storing back data
through updatable views or spt cursors,
the problem may be due to bypassing ODBC
on the way back to Access, reading in free DBF
tables, where access needs curly braces, while
those fields are autoconverted by ODBC.

Bye, Olaf.
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.