Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Error saving recordset
Message
De
16/05/2007 18:14:35
 
 
À
Cetin Basoz
Engineerica Inc.
Izmir, Turquie
Information générale
Forum:
Visual FoxPro
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
Titre:
Error saving recordset
Divers
Thread ID:
01226204
Message ID:
01226204
Vues:
53
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')
...
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform