Hi,
Thank you for your enquiry.
I don't think it is possible to retrieve the contents of a specific cell via an ODBC connection, but you should be able to narrow down to the required cell using the GetRecordAt() function (to select the row) and field name (to select the column).
For example, if your Excel worksheet contained the following data:
and you wanted to display the contents of cell A4 in a text box, you could use the following script actions:
Code:
var db = new Database("FILEDSN=C:\\Documents and Settings\\Rgarrett\\Desktop\\contacts.dsn;") //replace this with the path to your DSN file
var RecSet = db.ExecuteSQL("SELECT * FROM [Sheet1$];") //selects all records from the worksheet
RecSet.GetRecordAt(3) //focusses on the third row of data (which is actually the fourth row of the worksheet as the field names are not counted)
result = RecSet.Name //focusses on the first column of data
Now simply create a publication variable named 'result' and insert it into a text box. Preview the publication and the contents of cell A4 (which in this case would be "Camilla Johnson") should be displayed.
I hope this helps. Please do not hesitate to contact me if you have any further queries.
Kind regards,