Solved

convert string to replicationID in Access 2013

Posted on 2014-04-22
6
118 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 34

Expert Comment

by:PatHartman
Comment Utility
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
Comment Utility
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
Comment Utility
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
Enabling OSINT in Activity Based Intelligence

Activity based intelligence (ABI) requires access to all available sources of data. Recorded Future allows analysts to observe structured data on the open, deep, and dark web.

 

Author Comment

by:dakota5
Comment Utility
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
Comment Utility
Appears to be no way to do this.
0
 

Author Closing Comment

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

Featured Post

What Should I Do With This Threat Intelligence?

Are you wondering if you actually need threat intelligence? The answer is yes. We explain the basics for creating useful threat intelligence.

Join & Write a Comment

It took me quite some time to sort out all the different properties of combo and list boxes available from Visual Basic at run-time. Not that the documentation is lacking: the help pages are quite thorough and well written. The problem was rather wh…
Regardless of which version on MS Access you are using, one of the harder data-entry forms to create is one where most data from previous entries needs to be appended to new records, especially when there are numerous fields and records involved.  W…
What’s inside an Access Desktop Database. Will look at the basic interface, Navigation Pane (Database Container), Tables, Queries, Forms, Report, Macro’s, and VBA code.
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…

771 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

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now