Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Error 1495
Message
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Title:
Miscellaneous
Thread ID:
00914356
Message ID:
00916087
Views:
11
>Hi Doru,
>
>Do you've code to repro this problem? Did you tested under VFP9Beta?

Hi Sergey,
I expected that the code below catches the error and returns 'reverted', Instead it displays the warning "the key... is not unique" and displays 'success'. I run it in VFP8 and VFP9beta, and it behaves the same way.
set default to x:\foxv\doru\trap1495\
set path to x:\foxv\doru\trap1495\
on error

create database repro1495

create table repro1495 free (pk c(1), val1 c(10))
index on pk tag pk
insert into repro1495 (pk, val1) values ('1', 'record1')
insert into repro1495 (pk, val1) values ('2', 'record2')
insert into repro1495 (pk, val1) values ('2', 'record3')
insert into repro1495 (pk, val1) values ('3', 'record4')

CREATE SQL VIEW "lv_repro1495" ; 
   AS SELECT repro1495.pk, repro1495.val1 FROM repro1495

DBSetProp('lv_repro1495', 'View', 'UpdateType', 1)
DBSetProp('lv_repro1495', 'View', 'WhereType', 3)
DBSetProp('lv_repro1495', 'View', 'FetchMemo', .T.)
DBSetProp('lv_repro1495', 'View', 'SendUpdates', .T.)
DBSetProp('lv_repro1495', 'View', 'UseMemoSize', 255)
DBSetProp('lv_repro1495', 'View', 'FetchSize', 100)
DBSetProp('lv_repro1495', 'View', 'MaxRecords', -1)
DBSetProp('lv_repro1495', 'View', 'Tables', 'repro1495')
DBSetProp('lv_repro1495', 'View', 'Prepared', .F.)
DBSetProp('lv_repro1495', 'View', 'CompareMemo', .T.)
DBSetProp('lv_repro1495', 'View', 'FetchAsNeeded', .F.)
DBSetProp('lv_repro1495', 'View', 'Comment', "")
DBSetProp('lv_repro1495', 'View', 'BatchUpdateCount', 1)
DBSetProp('lv_repro1495', 'View', 'ShareConnection', .F.)

*!* Field Level Properties for lv_repro1495
* Props for the lv_repro1495.pk field.
DBSetProp('lv_repro1495.pk', 'Field', 'KeyField', .T.)
DBSetProp('lv_repro1495.pk', 'Field', 'Updatable', .T.)
DBSetProp('lv_repro1495.pk', 'Field', 'UpdateName', 'repro1495.pk')
DBSetProp('lv_repro1495.pk', 'Field', 'DataType', "C(10)")
* Props for the lv_repro1495.val1 field.
DBSetProp('lv_repro1495.val1', 'Field', 'KeyField', .F.)
DBSetProp('lv_repro1495.val1', 'Field', 'Updatable', .T.)
DBSetProp('lv_repro1495.val1', 'Field', 'UpdateName', 'repro1495.val1')
DBSetProp('lv_repro1495.val1', 'Field', 'DataType', "C(10)")

close databases all

use repro1495

open database repro1495.DBC

select 0
USE lv_repro1495
goto 3
replace val1 with 'xxxxxx'
try
	tableupdate(2,.t.)
	?'success'
catch to oErr
	if oErr.errorNo = 1495
		tablerevert()
		?'reverted'
	endif
endtry
Doru
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform