Using Replication ID data type in VB?

R

Rico

Hello,

I have an Access 2003 database where I'm using the Autonumber with the
Replication ID data type and have a second table and storing that
replication id in a numeric field (also specified as teh Replication ID data
type).

I'm trying to write a VB function where I'm trying to pass in the
Replication ID and match it to another Replication ID using SQL and an ADODB
connection. My problem is I keep getting a data type mismatch. When I
reference the data right from the field, I get "????????" as a result.

Any ideas? Any help would be greatly appreciated.

Thanks!
Rick
 
D

David W. Fenton

Rico said:
I have an Access 2003 database where I'm using the Autonumber with
the Replication ID data type and have a second table and storing
that replication id in a numeric field (also specified as teh
Replication ID data type).

I'm trying to write a VB function where I'm trying to pass in the
Replication ID and match it to another Replication ID using SQL
and an ADODB connection. My problem is I keep getting a data type
mismatch. When I reference the data right from the field, I get
"????????" as a result.

Read this:

Replication and GUIDs, the Good, the Bad, and the Ugly
http://trigeminal.com/usenet/usenet011.asp?1033

That explains the kinds of problems you have with VB/VBA and Jet and
DAO and ADO in type casting. Is it a string? Or isn't? So, you end
up having to use StringFromGUID (in Access, at least) and
GUIDFromString, and, naturally, all that conversion makes things
less efficient.

Why do you think you need GUIDs? I've never needed them in any of
the dozens of replicated apps I've created in the last 10 years --
random autonumbers work just fine.
 
J

Jamie Collins

Why do you think you need GUIDs? I've never needed them in any of
the dozens of replicated apps I've created in the last 10 years --
random autonumbers work just fine.

If you can't answer my question, "How likely am I to get clashes with
a random INTEGER autonumber?" then I've probably answered yours <g>.

Jamie.

--
 
D

David W. Fenton

If you can't answer my question, "How likely am I to get clashes
with a random INTEGER autonumber?" then I've probably answered
yours <g>.

The likelihood should be pretty easy to calculate if you know
approximately how many records your tables will have in them. None
of my clients in 10 years of using replication with random
Autonumber PKs has ever experienced a PK collision.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top