Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Error in SQL Server 7 rowguid col. 1

Status
Not open for further replies.

JohnBates

MIS
Joined
Feb 27, 2000
Messages
1,995
Location
US
Hello -
I am using VB6 with a SQL Server 7 database.

When I attempt to ADD a row to the recordset (ex: rsLoadId.Update)...get this error:

btnOpenSpur_Click: 01000: [ODBC SQL Server Driver] The statement has been terminated.
23000: [SQL Server] Cannot insert the value NULL into column 'rowguid', table 'frigdare.dbo.LoadId';
column does not allow nulls. INSERT fails.
Error: 40002=> '01000:[SQL Server] The statement has been terminated' Occurred at line : 100

rsLoadId.AddNew
.
. populate the columns...
.
.


and Line 100 is: rsLoadId.Update (the Error occurs here)


Of course, I do no move anything into the rowguid column,
so I am puzzled by this error...

Does anyone know why this would occur ??

Thanks for any ideas.
 
Sounds like you are trying to insert a NULL value into the column named "rowguid" in the table named "frigdare" using the command button "btnOpenSpur_Click()" and the column "rowguid" will not allow NULL values. You probably need to change the table column to allow NULL values or insert a value in the NULL space you are trying to update. I'm new to this but hope this helps. There is a VisualBasic Database forum on this site also. You'll probably get better answers there.
 
More info to rtshort and others....

rowguid is a col. generated by SQL Server to make certain that every row is unique.

No, I am not referencing or altering rowguid in my VB code.

Frigdare is the database, LoadId is the table.

I have posted this to the VB General forum... but will also post to VB Database forum. Thanks for the suggestion.

Thanks to rtshort and anyone else who takes a shot at this one!

John

 
If the data fields data type) are text (adLongVarChar) then

rsLoadId.AddNew
rsLoadId!Name = txtName & ""
rsLoadId.Update

If the data fields are Nummeric or Date fileds then

rsLoadId.AddNew
if txtPhone = "" then
rsLoadId!TelNumber = Null
Else
rsLoadId!TelNumber = txtPhone
end if

rsLoadId.Update
Eric De Decker
vbg.be@vbgroup.nl

License And Copy Protection AxtiveX.

Download Demo version on my Site:
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top