Hello All
I would like to put data out of a .dbf table into an Excel sheet over ODBC. I am able to send values with the following code... so far so good. But actually I would like to send the result of an array or an sql query. My feeling says it should be possible but I can't figure out how. I would be very glad for hints.
STORE 0 TO lnConHand, lnSQLRes
strforconn="Driver={Microsoft Excel Driver (*.xls)};" ;
+"DriverId=790;" ;
+"Dbq=C:\Documents and Settings\Desktop\testio.xls;" ;
+"ReadOnly=0;" ;
+"DefaultDir=C:\Documents and Settings\Desktop;"
lnConHand = SQLSTRINGCONNECT(strforconn)
IF lnConHand>0
ret=SQLEXEC(lnConHand, "INSERT INTO [sheet1$] (Date, Number) VALUES ('01.01.2002', 100.2)")
IF ret<0
MESSAGEBOX(areeor(ret)
endif
ELSE
MESSAGEBOX("Could not establish ODBC connection for .xls handling")
ENDIF
lnSQLRes=SQLDISCONNECT(lnConHand)
I would like to put data out of a .dbf table into an Excel sheet over ODBC. I am able to send values with the following code... so far so good. But actually I would like to send the result of an array or an sql query. My feeling says it should be possible but I can't figure out how. I would be very glad for hints.
STORE 0 TO lnConHand, lnSQLRes
strforconn="Driver={Microsoft Excel Driver (*.xls)};" ;
+"DriverId=790;" ;
+"Dbq=C:\Documents and Settings\Desktop\testio.xls;" ;
+"ReadOnly=0;" ;
+"DefaultDir=C:\Documents and Settings\Desktop;"
lnConHand = SQLSTRINGCONNECT(strforconn)
IF lnConHand>0
ret=SQLEXEC(lnConHand, "INSERT INTO [sheet1$] (Date, Number) VALUES ('01.01.2002', 100.2)")
IF ret<0
MESSAGEBOX(areeor(ret)
endif
ELSE
MESSAGEBOX("Could not establish ODBC connection for .xls handling")
ENDIF
lnSQLRes=SQLDISCONNECT(lnConHand)