Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Updating Records in an MS SQL CE Database
Message
 
 
À
26/05/2009 16:29:37
Information générale
Forum:
Visual FoxPro
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
Versions des environnements
Visual FoxPro:
VFP 9
OS:
Windows XP SP2
Divers
Thread ID:
01401914
Message ID:
01402079
Vues:
49
I don't know about both of your questions. For my CA I always used Mark McCasland's CABuilder. Which article you're referring to?

>>>I am trying to insert records into a .net local data table (SQL Compact Edition .sdf File)
>>>
>>>I am using a cursor adapter since these is no ODBC driver for this.
>>>
>>>I can open the table just fine but I cannot get an insert to work. Is it possible to insert into an ADO table?
>>>
>>>This is what is being returned by aerror after the tableupdate()
>>>
>>> ( 1, 1) N 1435 ( 1435.00000000)
>>> ( 1, 2) C "Microsoft Cursor Engine : Multiple-step operation generated errors. Check each status value."
>>
>>John,
>>
>>Check this message #1398510 and the whole thread (you may check John's sample for mobile app too).
>
>Where is that article located? (If it's here, search bombed out.)
>
>I had been using the designer, but I converted this to code:
>
>I've never manually done an insert command in a CA before, so it's probable that I messed that up.
>
>
>CLEAR
>local loConnDataSource
>loConnDataSource = createobject('ADODB.Connection')
>loConnDataSource.ConnectionString = [provider=Microsoft.SQLSERVER.CE.OLEDB.3.5;Data Source=C:\MailDat.sdf]
>loConnDataSource.Open()
>lodo = CreateObject("CursorAdapter")
>lodo.Alias = "Test"
>lodo.DataSourceType="ADO"
>lodo.DataSource = createobject('ADODB.RecordSet')
>lodo.DataSource.CursorLocation   = 3  && adUseClient
>lodo.DataSource.LockType         = 3  && adLockOptimistic
>lodo.DataSource.ActiveConnection = loConnDataSource
>lodo.DataSource.CursorLocation   = 3  && adUseClient
>
>DO CASE
>  CASE .F.
>    *Microsoft Cursor Engine : Multiple-step operation generated errors. Check each status value
>    lodo.CursorSchema = "ID I, VAL I"
>    lodo.UpdatableFieldList = "ID, VAL"
>    lodo.UpdateNameList = "ID Test.ID, VAL Test.VAL"
>    lodo.Tables = "Test"
>    lodo.KeyFieldList ="ID"
>  CASE .T.
>    ** Cannot insert an empty row from a view or CursorAdapter into its base table(s).
>    lodo.InsertCmd="insert into Test (Val) Values (?Test.Val)"
>ENDCASE
>
>lodo.SelectCmd="select * from Test"
>lodo.CursorFill()
>
>INSERT INTO Test (Val) VALUES (2)
>
>? TABLEUPDATE()
>=aerror(a)
>LIST MEMORY LIKE a TO temp.txt
>
>TRY
>  CLOSE DATABASES ALL
>CATCH
>  =aerror(a)
>  LIST MEMORY LIKE a 
>  ? TABLEREVERT()
>  CLOSE DATABASES ALL
>ENDTRY
>
If it's not broken, fix it until it is.


My Blog
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform