Silverfrost Forums

Welcome to our forums

f90sql and excel

9 Dec 2008 1:55 #4086

Hello,

After successfully using f90sql to interface with .mdb files a while back, I thought it would be pretty straightforward to do the same with excel (reading values from certain columns of excel spreadsheets).

But I am having a spot of bother.

First I bind the column of interest with a variable (ELECTRICITY):

call f90SQLBindCol (StmtHndl, ColNumber, SQL_F_CHAR, ELECTRICITY, f90SQL_NULL_PTR, iRet)

Then a simple fetch statement:

call f90SQLExecDirect(StmtHndl,trim(SQLStmtStr),iRet) call f90SQLFetch(StmtHndl,iRet)

This is almost identical to the routine I used for the .mdb files but all I get is the error statement: HY010 function sequence error

Can anyone help?

DM

19 Dec 2008 10:57 #4117

I was hoping to see some comments on this post, as I have purchased f90sql, but not yet used it on a project, as the one I was to use it on did not proceed.

I would be interested in any update on use of f90sql or other methods to access and possibly update information in an excel spreadsheet.

To date, I have been dumping the spreadsheet info to a fixed format .prn file. It would certainly be good to access the .xls file, although my recent data sets are now in much larger .xlsx files.

John

23 Dec 2008 10:56 #4132

I have been refraining from posting as my experience with f90sql was a few years ago, but I don't like to see someone disappointed 😃

I too have successfully used f90 sql to interface with an Access database. Difference from DM is that I wrote new data to the database whereas he read existing data from one. Perhaps that explains why my code is rather more elaborate than his? Perhaps he is not giving code chapter and verse (in which case, let's at least see a full list of calls, in order) but I found there was a bit more to this stuff than 'bind and fetch'; in particular, I don't see the statement handle being allocated anywhere ...

DM, whence comes the 'error statement'? I made a call to full_sql_error after every other routine I used. Is that how you are getting the error message?

Andy

15 Jun 2009 10:11 #4701

Hello to those who replied. Sorry its taken me so long to come back to this.

As sparge said its not as simple as my 2 lines of code suggests. You do indeed need to call full_sql_error in order to determine if operations have been successful.

I'm afraid the way I got round this was to ditch the excel interface and use text files as input. Yes, this can be incredibly tediuos. But I was desperate to get the code running.

So I'm afraid I don't have answers to my own problem.

Thanks for responding

DM

Please login to reply.