Solved

convert string to replicationID in Access 2013

Posted on 2014-04-22
6
148 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 4
6 Comments
 
LVL 38

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 85
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
VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

 

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

Back Up Your Microsoft Windows Server®

Back up all your Microsoft Windows Server – on-premises, in remote locations, in private and hybrid clouds. Your entire Windows Server will be backed up in one easy step with patented, block-level disk imaging. We achieve RTOs (recovery time objectives) as low as 15 seconds.

Question has a verified solution.

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

Phishing attempts can come in all forms, shapes and sizes. No matter how familiar you think you are with them, always remember to take extra precaution when opening an email with attachments or links.
In Part II of this series, I will discuss how to identify all open instances of Excel and enumerate the workbooks, spreadsheets, and named ranges within each of those instances.
Learn how to number pages in an Access report over each group. Activate two pass printing by referencing the pages property: Add code to the Page Footers OnFormat event to capture the pages as there occur for each group. Use the pages property to …
In Microsoft Access, learn how to use Dlookup and other domain aggregate functions and one method of specifying a string value within a string. Specify the first argument, which is the expression to be returned: Specify the second argument, which …

623 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