Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Error saving recordset
Message
De
17/05/2007 04:41:31
Cetin Basoz
Engineerica Inc.
Izmir, Turquie
 
 
À
16/05/2007 18:14:35
Information générale
Forum:
Visual FoxPro
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
Divers
Thread ID:
01226204
Message ID:
01226247
Vues:
24
This message has been marked as the solution to the initial question of the thread.
>Hi Cetin,
>
>A while back you gave me some very good code to import a cursor into an Excel sheet. It created a temporary DBC, copied the cursor to a new table in it, did some magic with recordsets and ended with the cursor in the excel spreadsheet.
>
>That code has worked well on several occasions, but today it caused Error 1429 with message: "OLE IDispatch exception code 0 from Microsoft OLEDB Persistence Provider: Multiple-step operation generated errors. Check each status value..." and also "Current Recordset does not support bookmarks. This may be a limitation of the provider or of the selected cursortype."
>
>The offending line was loRs.Save('disconnectme.rst'). What do you think?
>
>TIA, Alex
>
>
>	LOCAL lnSelect,lcTempDBC,lcTempTable,lcXLSFile
>	lnSelect	= SELECT()
>	lcTempDir	= 'C:\Temp\' + SYS(2015) + '\'
>	lcTempDBC   = lcTempDir + 'MyDatabase.dbc'
>	lcTempTable = lcTempDir + 'MyTable.dbf'
>	MD (lcTempDir)
>	CREATE DATABASE (lcTempDBC)
>	COPY TO (lcTempTable) DATABASE (lcTempDBC) NAME MyTable
>	CLOSE DATABASES
>	SELECT (lnSelect)
>
>	* Codigo de Cetin
>	Local loRS as AdoDB.Recordset,loRS2 as AdoDB.Recordset,loCon as AdoDB.Connection
>	LOCAL loExcel AS Excel.Application,loWorkbook,loSheet
>	loCon = CreateObject('ADODB.connection')
>	loCon.ConnectionString = "Provider=VFPOLEDB;Data Source="+lcTempDBC
>	loCon.Open()
>	loRS = loCon.Execute('SELECT * FROM myTable')
>	IF FILE('disconnectme.rst')
>		ERASE disconnectme.rst
>	ENDIF
>	loRs.Save('disconnectme.rst')     &&  <-------------   Error here
>	loRS2 = CreateObject('ADODB.Recordset')
>	loRs2.Open('disconnectme.rst')
>...
>
I don't know, it might have dependencies to prevent a save, incompatible data etc.
Search here for "copyfromrecordset" and use that one instead.
Cetin
Çetin Basöz

The way to Go
Flutter - For mobile, web and desktop.
World's most advanced open source relational database.
.Net for foxheads - Blog (main)
FoxSharp - Blog (mirror)
Welcome to FoxyClasses

LinqPad - C#,VB,F#,SQL,eSQL ... scratchpad
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform