Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Error #1429 with VFPOLEDB
Message
 
 
To
19/07/2005 07:29:59
Cetin Basoz
Engineerica Inc.
Izmir, Turkey
General information
Forum:
Visual FoxPro
Category:
Troubleshooting
Environment versions
Visual FoxPro:
VFP 7 SP1
Database:
Visual FoxPro
Miscellaneous
Thread ID:
01033760
Message ID:
01033761
Views:
22
Cetin,

What is the value of lcTemp variable at the time of error?

>Some of my customers are reporting this error. Unfortunately I couldn't reproduce it with none of their data sets.
>"OLE IDispatch exception code 0 from Microsoft OLE DB Provider for Visual FoxPro: Command contains unrecognized phrase/keyword..."
>
>Error occurs in this routine (should be it based on steps they define):
>
>
>Function ExportToExcel
>Lparameters tcCursorName
>tcCursorName = Iif(Empty(m.tcCursorName),Alias(),m.tcCursorName)
>Local loConn As AdoDB.Connection, loRS As AdoDB.Recordset,;
>	lcTempRs, lcTemp, oExcel
>lcTemp = ForcePath(Sys(2015)+'.dbf',Sys(2023))
>lcTempRs = ForcePath(Sys(2015)+'.rst',Sys(2023))
>Select (m.tcCursorName)
>Copy To (m.lcTemp)
>loConn = Createobject("Adodb.connection")
>loConn.ConnectionString = "Provider=VFPOLEDB;Data Source="+Addbs(Sys(2023))
>loConn.Open()
>loRS = loConn.Execute("select * from "+JustStem(m.lcTemp))
>loRS.Save(m.lcTempRs) && Followed by loRS is not an object - should be here.
>loRS.Close
>loConn.Close
>Erase (m.lcTemp)
>loRS.Open(m.lcTempRs)
>
>oExcel = Createobject("Excel.Application")
>With oExcel
>	.WorkBooks.Add
>	With .ActiveWorkBook.ActiveSheet
>		.Name = "My Export"
>		.QueryTables.Add( loRS, .Range("A1")).Refresh()
>		.Range("A1").AutoFormat(8) && xlRangeAutoFormatColor2
>		.Range("A1").Activate
>	Endwith
>	.Visible = .T.
>Endwith
>loRs.Close
>Erase (m.lcTempRS)
>
Can anyone try this code and hopefully reproduce the error. Customers have VFPOLEDB version 7.x but updating one of them to 9.x didn't help.
>To test the code do any select SQL and pass cursorname to function (note in my case long field names weren't an issue). TIA.
>Cetin
--sb--
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform