A Microsoft Office (Excel, Word) forum. OfficeFrustration

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » OfficeFrustration forum » Microsoft Access » General Discussion
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

linke SQL table with auto generated numeric key



 
 
Thread Tools Display Modes
  #1  
Old September 15th, 2009, 07:41 AM posted to microsoft.public.access
Wilder Lo
external usenet poster
 
Posts: 1
Default linke SQL table with auto generated numeric key

In Access, how can I link a SQL table with a numeric key generated by SQL?
I've tried to do that but Access will take the field as text and cannot
retrieve the data from the data.
  #2  
Old September 15th, 2009, 06:20 PM posted to microsoft.public.access
Sylvain Lafontaine[_2_]
external usenet poster
 
Posts: 247
Default linke SQL table with auto generated numeric key

Access is compatible with some but not all numeric types of SQL-Server. For
example, INT works but not BIGINT. The presence of an Insert trigger that
will perform a second insertion into another table (for example in an audit
process) will also be the source of big problem.

--
Sylvain Lafontaine, ing.
MVP - Windows Live Platform
Email: sylvain2009 sylvainlafontaine com (fill the blanks, no spam please)
Independent consultant and remote programming for Access and SQL-Server
(French)


"Wilder Lo" Wilder wrote in message
...
In Access, how can I link a SQL table with a numeric key generated by SQL?
I've tried to do that but Access will take the field as text and cannot
retrieve the data from the data.



  #3  
Old September 16th, 2009, 03:02 AM posted to microsoft.public.access
Wilder Lo[_2_]
external usenet poster
 
Posts: 3
Default linke SQL table with auto generated numeric key

Is there any way to bypass this? Or is there another way to do something like
the auto generated key in SQL and accessible by ACCESS?

"Sylvain Lafontaine" wrote:

Access is compatible with some but not all numeric types of SQL-Server. For
example, INT works but not BIGINT. The presence of an Insert trigger that
will perform a second insertion into another table (for example in an audit
process) will also be the source of big problem.

--
Sylvain Lafontaine, ing.
MVP - Windows Live Platform
Email: sylvain2009 sylvainlafontaine com (fill the blanks, no spam please)
Independent consultant and remote programming for Access and SQL-Server
(French)


"Wilder Lo" Wilder wrote in message
...
In Access, how can I link a SQL table with a numeric key generated by SQL?
I've tried to do that but Access will take the field as text and cannot
retrieve the data from the data.




  #4  
Old September 16th, 2009, 03:51 AM posted to microsoft.public.access
Sylvain Lafontaine[_2_]
external usenet poster
 
Posts: 247
Default linke SQL table with auto generated numeric key

I don't know as you don't have provided any detail about your exact problem:
what is this numeric type and how its value for a new record is generated at
this moment. You should also say if this field is defined as the primary
key for the table on the SQL-Server and otherwise, if there is any unique
index for it.

You also don't say what you mean exactly with the expression "Access will
take the field as text and cannot retrieve the data from the data".

Finally, maybe that you have simply forgot to refresh (or recreate) the ODBC
Link after making some change to the sql-server table.

--
Sylvain Lafontaine, ing.
MVP - Windows Live Platform
Email: sylvain2009 sylvainlafontaine com (fill the blanks, no spam please)
Independent consultant and remote programming for Access and SQL-Server
(French)


"Wilder Lo" wrote in message
...
Is there any way to bypass this? Or is there another way to do something
like
the auto generated key in SQL and accessible by ACCESS?

"Sylvain Lafontaine" wrote:

Access is compatible with some but not all numeric types of SQL-Server.
For
example, INT works but not BIGINT. The presence of an Insert trigger
that
will perform a second insertion into another table (for example in an
audit
process) will also be the source of big problem.

--
Sylvain Lafontaine, ing.
MVP - Windows Live Platform
Email: sylvain2009 sylvainlafontaine com (fill the blanks, no spam
please)
Independent consultant and remote programming for Access and SQL-Server
(French)


"Wilder Lo" Wilder wrote in message
...
In Access, how can I link a SQL table with a numeric key generated by
SQL?
I've tried to do that but Access will take the field as text and cannot
retrieve the data from the data.






  #5  
Old September 28th, 2009, 05:27 AM posted to microsoft.public.access
Wilder Lo[_2_]
external usenet poster
 
Posts: 3
Default linke SQL table with auto generated numeric key

Here are the details:

On the SQL server I have a table with single key field of "bigint" data type
and auto increment.

I've linked the table in Access through ODBC, and choose the key field as
primary key, when I open up the table to see the data, all I can see is
"#Deleted" in every field and record. I've tried to remove the ODBC link and
re-link but still doesn't work.


"Sylvain Lafontaine" wrote:

I don't know as you don't have provided any detail about your exact problem:
what is this numeric type and how its value for a new record is generated at
this moment. You should also say if this field is defined as the primary
key for the table on the SQL-Server and otherwise, if there is any unique
index for it.

You also don't say what you mean exactly with the expression "Access will
take the field as text and cannot retrieve the data from the data".

Finally, maybe that you have simply forgot to refresh (or recreate) the ODBC
Link after making some change to the sql-server table.

--
Sylvain Lafontaine, ing.
MVP - Windows Live Platform
Email: sylvain2009 sylvainlafontaine com (fill the blanks, no spam please)
Independent consultant and remote programming for Access and SQL-Server
(French)


"Wilder Lo" wrote in message
...
Is there any way to bypass this? Or is there another way to do something
like
the auto generated key in SQL and accessible by ACCESS?

"Sylvain Lafontaine" wrote:

Access is compatible with some but not all numeric types of SQL-Server.
For
example, INT works but not BIGINT. The presence of an Insert trigger
that
will perform a second insertion into another table (for example in an
audit
process) will also be the source of big problem.

--
Sylvain Lafontaine, ing.
MVP - Windows Live Platform
Email: sylvain2009 sylvainlafontaine com (fill the blanks, no spam
please)
Independent consultant and remote programming for Access and SQL-Server
(French)


"Wilder Lo" Wilder wrote in message
...
In Access, how can I link a SQL table with a numeric key generated by
SQL?
I've tried to do that but Access will take the field as text and cannot
retrieve the data from the data.






  #6  
Old September 28th, 2009, 07:18 AM posted to microsoft.public.access
Sylvain Lafontaine[_2_]
external usenet poster
 
Posts: 247
Default linke SQL table with auto generated numeric key

You're not a lucky guy: the BigInt type is not compatible with Access, as
simple as that. You have no other choice than to change this type to
something else like Int.

--
Sylvain Lafontaine, ing.
MVP - Windows Live Platform
Email: sylvain2009 sylvainlafontaine com (fill the blanks, no spam please)
Independent consultant and remote programming for Access and SQL-Server
(French)


"Wilder Lo" wrote in message
...
Here are the details:

On the SQL server I have a table with single key field of "bigint" data
type
and auto increment.

I've linked the table in Access through ODBC, and choose the key field as
primary key, when I open up the table to see the data, all I can see is
"#Deleted" in every field and record. I've tried to remove the ODBC link
and
re-link but still doesn't work.


"Sylvain Lafontaine" wrote:

I don't know as you don't have provided any detail about your exact
problem:
what is this numeric type and how its value for a new record is generated
at
this moment. You should also say if this field is defined as the primary
key for the table on the SQL-Server and otherwise, if there is any unique
index for it.

You also don't say what you mean exactly with the expression "Access will
take the field as text and cannot retrieve the data from the data".

Finally, maybe that you have simply forgot to refresh (or recreate) the
ODBC
Link after making some change to the sql-server table.

--
Sylvain Lafontaine, ing.
MVP - Windows Live Platform
Email: sylvain2009 sylvainlafontaine com (fill the blanks, no spam
please)
Independent consultant and remote programming for Access and SQL-Server
(French)


"Wilder Lo" wrote in message
...
Is there any way to bypass this? Or is there another way to do
something
like
the auto generated key in SQL and accessible by ACCESS?

"Sylvain Lafontaine" wrote:

Access is compatible with some but not all numeric types of
SQL-Server.
For
example, INT works but not BIGINT. The presence of an Insert trigger
that
will perform a second insertion into another table (for example in an
audit
process) will also be the source of big problem.

--
Sylvain Lafontaine, ing.
MVP - Windows Live Platform
Email: sylvain2009 sylvainlafontaine com (fill the blanks, no spam
please)
Independent consultant and remote programming for Access and
SQL-Server
(French)


"Wilder Lo" Wilder wrote in message
...
In Access, how can I link a SQL table with a numeric key generated
by
SQL?
I've tried to do that but Access will take the field as text and
cannot
retrieve the data from the data.








  #7  
Old September 29th, 2009, 02:48 AM posted to microsoft.public.access
Wilder Lo[_2_]
external usenet poster
 
Posts: 3
Default linke SQL table with auto generated numeric key

Thanks a lot, by the way what is the largest Int number I can have?

"Sylvain Lafontaine" wrote:

You're not a lucky guy: the BigInt type is not compatible with Access, as
simple as that. You have no other choice than to change this type to
something else like Int.

--
Sylvain Lafontaine, ing.
MVP - Windows Live Platform
Email: sylvain2009 sylvainlafontaine com (fill the blanks, no spam please)
Independent consultant and remote programming for Access and SQL-Server
(French)


"Wilder Lo" wrote in message
...
Here are the details:

On the SQL server I have a table with single key field of "bigint" data
type
and auto increment.

I've linked the table in Access through ODBC, and choose the key field as
primary key, when I open up the table to see the data, all I can see is
"#Deleted" in every field and record. I've tried to remove the ODBC link
and
re-link but still doesn't work.


"Sylvain Lafontaine" wrote:

I don't know as you don't have provided any detail about your exact
problem:
what is this numeric type and how its value for a new record is generated
at
this moment. You should also say if this field is defined as the primary
key for the table on the SQL-Server and otherwise, if there is any unique
index for it.

You also don't say what you mean exactly with the expression "Access will
take the field as text and cannot retrieve the data from the data".

Finally, maybe that you have simply forgot to refresh (or recreate) the
ODBC
Link after making some change to the sql-server table.

--
Sylvain Lafontaine, ing.
MVP - Windows Live Platform
Email: sylvain2009 sylvainlafontaine com (fill the blanks, no spam
please)
Independent consultant and remote programming for Access and SQL-Server
(French)


"Wilder Lo" wrote in message
...
Is there any way to bypass this? Or is there another way to do
something
like
the auto generated key in SQL and accessible by ACCESS?

"Sylvain Lafontaine" wrote:

Access is compatible with some but not all numeric types of
SQL-Server.
For
example, INT works but not BIGINT. The presence of an Insert trigger
that
will perform a second insertion into another table (for example in an
audit
process) will also be the source of big problem.

--
Sylvain Lafontaine, ing.
MVP - Windows Live Platform
Email: sylvain2009 sylvainlafontaine com (fill the blanks, no spam
please)
Independent consultant and remote programming for Access and
SQL-Server
(French)


"Wilder Lo" Wilder wrote in message
...
In Access, how can I link a SQL table with a numeric key generated
by
SQL?
I've tried to do that but Access will take the field as text and
cannot
retrieve the data from the data.









  #8  
Old September 29th, 2009, 04:28 AM posted to microsoft.public.access
Sylvain Lafontaine[_2_]
external usenet poster
 
Posts: 247
Default linke SQL table with auto generated numeric key

A little higher than 2 billions: 2 000 000 000.

--
Sylvain Lafontaine, ing.
MVP - Windows Live Platform
Email: sylvain2009 sylvainlafontaine com (fill the blanks, no spam please)
Independent consultant and remote programming for Access and SQL-Server
(French)


"Wilder Lo" wrote in message
...
Thanks a lot, by the way what is the largest Int number I can have?

"Sylvain Lafontaine" wrote:

You're not a lucky guy: the BigInt type is not compatible with Access, as
simple as that. You have no other choice than to change this type to
something else like Int.

--
Sylvain Lafontaine, ing.
MVP - Windows Live Platform
Email: sylvain2009 sylvainlafontaine com (fill the blanks, no spam
please)
Independent consultant and remote programming for Access and SQL-Server
(French)


"Wilder Lo" wrote in message
...
Here are the details:

On the SQL server I have a table with single key field of "bigint" data
type
and auto increment.

I've linked the table in Access through ODBC, and choose the key field
as
primary key, when I open up the table to see the data, all I can see is
"#Deleted" in every field and record. I've tried to remove the ODBC
link
and
re-link but still doesn't work.


"Sylvain Lafontaine" wrote:

I don't know as you don't have provided any detail about your exact
problem:
what is this numeric type and how its value for a new record is
generated
at
this moment. You should also say if this field is defined as the
primary
key for the table on the SQL-Server and otherwise, if there is any
unique
index for it.

You also don't say what you mean exactly with the expression "Access
will
take the field as text and cannot retrieve the data from the data".

Finally, maybe that you have simply forgot to refresh (or recreate)
the
ODBC
Link after making some change to the sql-server table.

--
Sylvain Lafontaine, ing.
MVP - Windows Live Platform
Email: sylvain2009 sylvainlafontaine com (fill the blanks, no spam
please)
Independent consultant and remote programming for Access and
SQL-Server
(French)


"Wilder Lo" wrote in message
...
Is there any way to bypass this? Or is there another way to do
something
like
the auto generated key in SQL and accessible by ACCESS?

"Sylvain Lafontaine" wrote:

Access is compatible with some but not all numeric types of
SQL-Server.
For
example, INT works but not BIGINT. The presence of an Insert
trigger
that
will perform a second insertion into another table (for example in
an
audit
process) will also be the source of big problem.

--
Sylvain Lafontaine, ing.
MVP - Windows Live Platform
Email: sylvain2009 sylvainlafontaine com (fill the blanks, no spam
please)
Independent consultant and remote programming for Access and
SQL-Server
(French)


"Wilder Lo" Wilder wrote in message
...
In Access, how can I link a SQL table with a numeric key
generated
by
SQL?
I've tried to do that but Access will take the field as text and
cannot
retrieve the data from the data.











  #9  
Old September 29th, 2009, 05:19 AM posted to microsoft.public.access
John W. Vinson
external usenet poster
 
Posts: 18,261
Default linke SQL table with auto generated numeric key

On Mon, 28 Sep 2009 18:48:02 -0700, Wilder Lo
wrote:

Thanks a lot, by the way what is the largest Int number I can have?


2147483647; and if you count negatives, from -2147483648 up to zero.

I once figured out how long it would take to use up all the Long Int keys.
Adding one record per second, 24-7, no time off for holidays, it comes to a
bit over 68 years.

--

John W. Vinson [MVP]
 




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump


All times are GMT +1. The time now is 09:49 AM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.