Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8283929
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 8, 20262026-06-08T10:55:08+00:00 2026-06-08T10:55:08+00:00

I was previously using: Public Declare Function StringFromGUID2 Lib ole32.dll _ (rclsid As GUID,

  • 0

I was previously using:

Public Declare Function StringFromGUID2 Lib "ole32.dll" _
    (rclsid As GUID, ByVal lpsz As Long, ByVal cbMax As Long) As Long

under Access 2007 on both 32 bit and 64 bit Windows to generate GUIDs for me.

Where GUID Is defined as:

Public Type GUID
Data1 As Long
Data2 As Integer
Data3 As Integer
Data4(7) As Byte
End Type

(since VT_GUID wasn’t supported in VBA for variants)

I’ve now got a new machine that is set up with Access 2010 64 bit and this stuff is now broken.

What is the equivalent code to do this under Access 2010 64 bit?

I have added the PtrSafe attribute as required:

Public Declare PtrSafe Function StringFromGUID2 Lib "ole32.dll" _
    (rclsid As GUID, ByVal lpsz As Long, ByVal cbMax As Long) As Long

This causes a type mismatch at the actual call:

Dim rc As Long
Dim stGuid As String
' 39 chars  for the GUID plus room for the Null char
stGuid = String$(40, vbNullChar)
rc = StringFromGUID2(rclsid, StrPtr(stGuid), Len(stGuid) - 1)

Which is to be expected since StrPtr will return a LongPtr on 64 bit and a Long on 32 bit systems.

I’m not a full-time developer so I’m not sure what is the most appropriate way to create GUID strings in a way that will work on both 32 and 64 bit systems.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-08T10:55:10+00:00Added an answer on June 8, 2026 at 10:55 am

    StringFromGUID is available to the Access application.

    Application.StringFromGUID Method (Access)

    You can even use it in queries.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am working on some code that previously was using a cfquery, and is
I'm looking to implement a REST client in PHP, and have previously been using
previously i was using picture box and its built in utilities to draw some
I have deployed a PHP application on my tomcat server(Tomcat 6.0).Previously I was using
I'm developing a graph control in WPF. I have previously developed it using GDI
Previously when I browsed source code files using Xcode's file browser (located on left
Previously within my Fitnesse fixture I was specifying an expected WCF exception using: exception[FaultException]
Previously, I am using STL map to perform the mentioned task. struct ltstr {
I previously had a table that is created using hibernate entities. I am using
I have previously written user interfaces using .NET and Windows Forms. I'm about to

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.