Solved

convert string to replicationID in Access 2013

Posted on 2014-04-22
6
135 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 36

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
U.S. Department of Agriculture and Acronis Access

With the new era of mobile computing, smartphones and tablets, wireless communications and cloud services, the USDA sought to take advantage of a mobilized workforce and the blurring lines between personal and corporate computing resources.

 

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

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

This article is a continuation or rather an extension from Cascading Combos (http://www.experts-exchange.com/A_5949.html) and builds on examples developed in detail there. It should be understandable alone, but I recommend reading the previous artic…
Experts-Exchange is a great place to come for help with solutions for your database issues, and many problems are resolved within minutes of being posted.  Others take a little more time and effort and often providing a sample database is very helpf…
Familiarize people with the process of utilizing SQL Server views from within Microsoft Access. Microsoft Access is a very powerful client/server development tool. One of the SQL Server objects that you can interact with from within Microsoft Access…
Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…

838 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