Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 441
Default 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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Quick Question Dave Excel Discussion (Misc queries) 3 February 18th 09 06:00 PM
Quick Question Nikki Excel Worksheet Functions 4 January 31st 06 02:51 PM
Quick Question Jenn Excel Discussion (Misc queries) 2 November 1st 05 09:20 PM
Quick If Question RPIJG[_47_] Excel Programming 1 June 15th 04 07:48 PM
Quick Question Jayhawktc[_2_] Excel Programming 1 April 14th 04 02:09 PM


All times are GMT +1. The time now is 05:12 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"