Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Quick Syntax Question
Should i want a querytable that only returns one value to assign the returned
value to a string variable, how would i do that, the code as it looks now is... dim vReturnValue integer Dim vSQLTable As New QueryTable sqlstring = "DECLARE @ReturnValue INT exec FAKE_TEMP_TABLE 'InputParameter', @OutputParam = @ReturnValue OUTPUT print @ReturnValue" connstring = _ "ODBC;DSN=serverName;UID=;PWD=;Database=DBName " 'This is what I dont know how to do vReturnValue = "returned value from datatable" |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Quick Syntax Question
The very nature of the QueryTable is that it is a spreadsheet object. I think
you need to either: 1) Return your data to a spreadsheet (even a temp sheet that can be deleted after the query) and then copy your result into a variable; OR 2) Return your information in a recordset, which will require that you alter your DAO or ADO code somewhat. --- Can't help you there since your code wasn't posted... HTH "UNOTech" wrote: Should i want a querytable that only returns one value to assign the returned value to a string variable, how would i do that, the code as it looks now is... dim vReturnValue integer Dim vSQLTable As New QueryTable sqlstring = "DECLARE @ReturnValue INT exec FAKE_TEMP_TABLE 'InputParameter', @OutputParam = @ReturnValue OUTPUT print @ReturnValue" connstring = _ "ODBC;DSN=serverName;UID=;PWD=;Database=DBName " 'This is what I dont know how to do vReturnValue = "returned value from datatable" |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Quick Question | Excel Discussion (Misc queries) | |||
Quick Question | Excel Worksheet Functions | |||
Quick Question | Excel Discussion (Misc queries) | |||
Quick If Question | Excel Programming | |||
Quick Question | Excel Programming |