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 78435
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 10, 20262026-05-10T20:59:13+00:00 2026-05-10T20:59:13+00:00

MS Access allows the numeric type GUID (in German it’s called ‘Replikations-ID’, so I

  • 0

MS Access allows the numeric type GUID (in German it’s called ‘Replikations-ID’, so I guess in English that would be ‘replication id’) which is stored as a 16 byte binary field in the database.

I found how to access these fields in Delphi with TADOQuery/TADOTable using

(TheQuery.FieldByName('SomeGuidField') as TGUIDField).AsGuid; 

But now I want to execute an SQL-Query like this:

SELECT * FROM SomeTable WHERE SomeGuidField=:AGuid 

I tried setting a TADOQuery.SQL property to the above statement, but found no way to actually set the AGuid parameter such that the query can be opened. Whatever I tried resulted in the (ADO/COM) error

No value given for one or more required parameters

For example:

TheQuery.ParamByName('AGuid').Value := QuotedString(GuidToStr(AGuid)); TheQuery.Open; // <<== crashes here 

This doesn’t work either:

TheQuery.ParamByName('AGuid').Value := GuidToStr(AGuid); TheQuery.Open; // <<== crashes here 

I had a look at how TGuidField(...).AsGuid works and found that it first converts the GUID to a string and then the string to a variant (and vice versa).

It works fine, if I always generate the SQL-Statement like this:

SELECT * FROM SomeTable WHERE SomeGuidField='<a guid goes here>' 

As I am passing that TADOQuery object around in the program I would like to only change the AGuid-Parameter to keep most methods agnostic on the actual SQL-Statement.

Is there any other way to set a GUID-Parameter than always change the complete SQL-Statement?

(It must be a GUID because I need a globally unique identifier to synchronize with other databases which are MS SQL or MS Access based.)

Edit vradmilovic is right, this works:

TheQuery.ParamByName('AGuid').Value := GuidToStr(AGuid); TheQuery.Open; 

I don’t understand why it didn’t work the first time I tried it.

  • 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. 2026-05-10T20:59:13+00:00Added an answer on May 10, 2026 at 8:59 pm

    That’s correct way to set parameters with ADO. The message you get is most probably due to typo with some of fields (you get same message if field does not exist).

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

Sidebar

Related Questions

How is it that Ruby allows a class access methods outside of the class
I am trying to make a php login page that allows users to access
I have a bound form in microsoft access that allows a user to add
I am creating a page that allows users access to a certain section of
I am creating a page that allows users access to a certain section of
I am creating a page that allows users access to a certain section of
I have see applications (like my router) that allows access via http. How exactly
I have a network share in the intranet that allows write access to everyone
CodeIgniter allows access to POSTed data via: $this->input->post('input_name'); where 'input_name' is the name of
// A Mutex allows threads mutually exclusive access to a resource. //----------------------------------------------------------------------- class Mutex

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.