Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

convert string to replicationID in Access 2013

Posted on 2014-04-22
6
Medium Priority
?
153 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 39

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
Ransomware: The New Cyber Threat & How to Stop It

This infographic explains ransomware, type of malware that blocks access to your files or your systems and holds them hostage until a ransom is paid. It also examines the different types of ransomware and explains what you can do to thwart this sinister online threat.  

 

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

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

AutoNumbers should increment automatically, without duplicates.  But sometimes something goes wrong, and the next AutoNumber value is a duplicate.  This article shows how to recover from this problem.
This article shows how to get a list of available printers for display in a drop-down list, and then to use the selected printer to print an Access report or a Word document filled with Access data, using different syntax as needed for working with …
Basics of query design. Shows you how to construct a simple query by adding tables, perform joins, defining output columns, perform sorting, and apply criteria.
Have you created a query with information for a calendar? ... and then, abra-cadabra, the calendar is done?! I am going to show you how to make that happen. Visualize your data!  ... really see it To use the code to create a calendar from a q…

721 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