Type Mismatch

L

Lauri

Background:
I am using Windows XP Pro, MS Access 2000 and linking to tables in a SQL
database.
If I use the same tables to create a main form and sub form, the
Parent/Child links work. But if I try to use a query to link a SQL table
and an Access Table, I get a type mismatch error. The types are set
correctly and since they work as parent/child links for subforms I'm
assuming that is confirmation that they work correctly.

Any ideas to get around the Type Mismatch error?
 
M

MGFoster

Lauri said:
Background:
I am using Windows XP Pro, MS Access 2000 and linking to tables in a SQL
database.
If I use the same tables to create a main form and sub form, the
Parent/Child links work. But if I try to use a query to link a SQL table
and an Access Table, I get a type mismatch error. The types are set
correctly and since they work as parent/child links for subforms I'm
assuming that is confirmation that they work correctly.

Any ideas to get around the Type Mismatch error?

You don't say what data type you're trying to link. In MS SQL Server if
you are linking VARCHAR (TEXT in Access) data types the declared column
width must be the same in both tables.

In a query, because of a formatting command on a column's value, the
value will be changed from one data type to another - usually from a
numeric data type to a string data type (Format() will do this).

Some numeric data types are not considered the same types when matching
Access to MS SQL'r. Read the Access help (in the contents):

Microsoft Jet SQL Reference
Microsoft Jet SQL Reference
Overview
Equivalent ANSI SQL Data Types <- this one

to see which data types match.
 
L

Lauri

Thank you. While looking up the width, it turns out I did have the wrong
data type. Long story as to why I had the wrong data type, but suffice it to
say, your explanation prompted me to look and I found the answer. Thank you
so much.

-Lauri
 

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