View previous topic :: View next topic |
Author |
Message |
dmcmillan
Joined: 04 Jul 2006 Posts: 22
|
Posted: Tue Dec 09, 2008 2:55 pm Post subject: f90sql and excel |
|
|
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 |
|
Back to top |
|
|
JohnCampbell
Joined: 16 Feb 2006 Posts: 2554 Location: Sydney
|
Posted: Fri Dec 19, 2008 11:57 pm Post subject: |
|
|
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 |
|
Back to top |
|
|
sparge
Joined: 11 Apr 2005 Posts: 371
|
Posted: Tue Dec 23, 2008 11:56 am Post subject: |
|
|
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 |
|
Back to top |
|
|
dmcmillan
Joined: 04 Jul 2006 Posts: 22
|
Posted: Mon Jun 15, 2009 11:11 am Post subject: belated reply |
|
|
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 |
|
Back to top |
|
|
|