Solved

convert string to replicationID in Access 2013

Posted on 2014-04-22
6
125 Views
Last Modified: 2015-06-21
Experts:

I'm able to use the function (actually called a method)  StringFromGuid to convert replicationIDs to strings using the design view of an Access 2013 query.

http://msdn.microsoft.com/en-us/library/office/ff193935%28v=office.15%29.aspx

The field in design view is

stringversion:   StringFromGUID([replicationID_field])

The new stringversion field has entries like
{8AE8A52C-7A97-E111-8EA6-0022191D9ED3} which are actually strings.  Works fine.

But when I try to use the method GUIDfromString to convert back,  I get Chinese characters.

The field in design view to go back to ReplicationID is

GUIDversion: GUIDfromString([stringversion])

When I use a make table query, the new field is a string, not a ReplicationID

I guess the string that is the input to GUIDfromString needs special formatting.

Anyone know how to get this to run in the design window?
0
Comment
Question by:dakota5
  • 4
6 Comments
 
LVL 35

Expert Comment

by:PatHartman
ID: 40016163
Isn't the whole point of a GUID that it be unique?  If you are trying to make it the PK of a different table, doesn't that violate the "uniqueness" property?

If you are trying to add rows to a table and you want to keep the GUIDs generated in their original table, I would guess you would do it the way you would with other autonumbers.  Use an append query.  Select from tblA and append to tblB.  Include the PK in the columns being appended to.
0
 

Author Comment

by:dakota5
ID: 40016179
Yes, the GUIDs are unique for a row of data, or a subset of the row of data.  A research group that provides these tables has sometimes provided the GUID as strings, and sometimes as a true GUID.

Just trying to learn how to translate back to GUID within MS Access, since I can translate from GUID to string.
0
 
LVL 84
ID: 40017159
So when you convert the GUID to a String, what does it end up looking like? Many times a GUID will be enclosed in curly braces (  {GUID}  ) - do you end up with something like that, or something else?

If you do NOT have the curly braces, try adding them to the string before you call the GUIDFromString method. If it does have the curly braces, try removing them.

FWIW, it seems Access always had a tough time dealing with GUIDs. I tried using them for a project one time that would be used in different places (to maintain uniqueness, or so I though) and they were much more trouble than they're worth.
0
Comprehensive Backup Solutions for Microsoft

Acronis protects the complete Microsoft technology stack: Windows Server, Windows PC, laptop and Surface data; Microsoft business applications; Microsoft Hyper-V; Azure VMs; Microsoft Windows Server 2016; Microsoft Exchange 2016 and SQL Server 2016.

 

Author Comment

by:dakota5
ID: 40017940
Hi-
In Access, the replicationID field looks like  {8AE8A52C-7A97-E111-8EA6-0022191D9ED3}
It displays with the brackets around it.
After I convert to text, I get the same thing-- including the brackets.
{8AE8A52C-7A97-E111-8EA6-0022191D9ED3}

I've tried going back to GUID using GUIDFromString on the string including the brackets, and I've also tried removing the brackets.  Also tried quotes around everything and no quotes too.
Nothing works in that direction.
0
 

Accepted Solution

by:
dakota5 earned 0 total points
ID: 40833864
Appears to be no way to do this.
0
 

Author Closing Comment

by:dakota5
ID: 40841886
No one provided an answer.  I don't want to delete the question, because it is an important question.
0

Featured Post

Simplifying Server Workload Migrations

This use case outlines the migration challenges that organizations face and how the Acronis AnyData Engine supports physical-to-physical (P2P), physical-to-virtual (P2V), virtual to physical (V2P), and cross-virtual (V2V) migration scenarios to address these challenges.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

I originally created this report in Crystal Reports 2008 where there is an option to underlay sections. I initially came across the problem in Access Reports where I was unable to run my border lines down through the entire page as I was using the P…
In a multiple monitor setup, if you don't want to use AutoCenter to position your popup forms, you have a problem: where will they appear?  Sometimes you may have an additional problem: where the devil did they go?  If you last had a popup form open…
In Microsoft Access, learn how to “cascade” or have the displayed data of one combo control depend upon what’s entered in another. Base the dependent combo on a query for its row source: Add a reference to the first combo on the form as criteria i…
Access reports are powerful and flexible. Learn how to create a query and then a grouped report using the wizard. Modify the report design after the wizard is done to make it look better. There will be another video to explain how to put the final p…

777 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question