dbTalk Databases Forums  

you tried to assign null value to a variable that is not a variant

comp.databases.ms-access comp.databases.ms-access


Discuss you tried to assign null value to a variable that is not a variant in the comp.databases.ms-access forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
musicloverlch
 
Posts: n/a

Default you tried to assign null value to a variable that is not a variant - 03-23-2011 , 01:46 PM






OK, I'm pulling my hair out. I'm trying to append records to a table.
No code, just an append query. When the table is in the same
database, it works fine.

But I need to update tables in a linked database. When I do that it
will say "you tried to assign null value to a variable that is not a
variant data type" about 80% of the time.

I really need the append query to work.

Help me! Please!

Thanks,
Laura

Reply With Quote
  #2  
Old   
Bob Barrows
 
Posts: n/a

Default Re: you tried to assign null value to a variable that is not a variant - 03-23-2011 , 02:16 PM






I just ran into this a few weeks ago. My problem was caused by nullable bit
fields in the remote sql server database. This rendered the table
essentially read-only. I had to change the table schema in the remote
database to solve this problem:

ALTER TABLE dbo.tablename
ADD CONSTRAINT df_bitcolname
DEFAULT 0 FOR bitcolname WITH VALUES
GO
ALTER TABLE dbo.tablename
ALTER COLUMN bitcolname BIT NOT null

Once I did this my problem was solved.

musicloverlch wrote:
Quote:
OK, I'm pulling my hair out. I'm trying to append records to a table.
No code, just an append query. When the table is in the same
database, it works fine.

But I need to update tables in a linked database. When I do that it
will say "you tried to assign null value to a variable that is not a
variant data type" about 80% of the time.

I really need the append query to work.

Help me! Please!

Thanks,
Laura

Reply With Quote
  #3  
Old   
musicloverlch
 
Posts: n/a

Default Re: you tried to assign null value to a variable that is not a variant - 03-24-2011 , 08:47 AM



Thanks Bob!

I'll try that!

On Mar 23, 3:16*pm, "Bob Barrows" <reb01... (AT) NOyahooSPAM (DOT) com> wrote:
Quote:
I just ran into this a few weeks ago. My problem was caused by nullable bit
fields in the remote sql server database. This rendered the table
essentially read-only. I had to change the table schema in the remote
database to solve this problem:

ALTER TABLE dbo.tablename
ADD CONSTRAINT df_bitcolname
DEFAULT 0 *FOR bitcolname WITH VALUES
GO
ALTER TABLE dbo.tablename
ALTER COLUMN bitcolname BIT NOT null

Once I did this my problem was solved.



musicloverlch wrote:
OK, I'm pulling my hair out. I'm trying to append records to a table.
No code, just an append query. *When the table is in the same
database, it works fine.

But I need to update tables in a linked database. When I do that it
will say "you tried to assign null value to a variable that is not a
variant data type" about 80% of the time.

I really need the append query to work.

Help me! Please!

Thanks,
Laura- Hide quoted text -

- Show quoted text -

Reply With Quote
Reply




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 On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.