|
-
Mar 31st, 2000, 02:55 AM
#1
Thread Starter
New Member
SQL Server 7 and VB6
The table in sql the primary key is an identity field, incremented by 1.
I am creating a data entry app in vb and need to pull the next incremented value from sql in order to save the record.
I have done this in oracle:
declare global variable: Global gvCustid as long
cmdAddnew:
With deCes.rscdInvitee
gvNextCustID = !nextval
End With
txtCustID.Text = gvNextCusID
When I have tried this code I have been receiving the error: field not updatable, bound property.
If this code is eliminated I receive the error from my code. :
updateerror:
MsgBox Err.Description, vbOKOnly + vbCritical, _
"Error"
The description is Errors Occured.
Any advice would be greatly appreciated.
Thank you
Brandy
-
Mar 31st, 2000, 05:26 AM
#2
Frenzied Member
Don't use identity records in SQL server but that's another story. You don't pass a value to the identity field, SQL server does.
You could find out what SQL server is going to set the value to by
select max(identityFld) from table
Just add the increment to the retrieved value. If you don't know (in this case you do) what the increment value is you can use the function "ident_incr" to determine it.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|