Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2000 Forums
 SQL Server Development (2000)
 Excel prompt to SQL SP

Author  Topic 

UnJoyMyself
Starting Member

3 Posts

Posted - 2007-08-22 : 15:44:06

I am trying to create a report in Excel so when it is opened, it executes a SQL SP. I want the user to be able enter a parameter value in excel that is sent to the SP for evaluation. If I where building this in Crystal I would just create the variable like :
@personidno char(10)
then B4 Crystal runs it would prompts you, ... but I am not sure how to make that happen in Excel. any ideas?

SwePeso
Patron Saint of Lost Yaks

30421 Posts

Posted - 2007-08-22 : 15:51:33
MsgBox to get the value, and then create a parameter with this value.



E 12°55'05.25"
N 56°04'39.16"
Go to Top of Page

UnJoyMyself
Starting Member

3 Posts

Posted - 2007-08-22 : 15:58:34
So how do I create the message box/parameter? VB? Not too familiar with VB
Go to Top of Page

SwePeso
Patron Saint of Lost Yaks

30421 Posts

Posted - 2007-08-22 : 16:03:27
Actually it is VBA.
If you have no idea, it will take too long time to learn you now.

See this topic for more information how to create connection to database
http://www.sqlteam.com/forums/topic.asp?TOPIC_ID=70783



E 12°55'05.25"
N 56°04'39.16"
Go to Top of Page

UnJoyMyself
Starting Member

3 Posts

Posted - 2007-08-22 : 16:13:37
Ok thanks! I do have a connection to the database though. I am just using the import data function in excel and in the query I just execute the SP I created on the server. I thought there may be an easy solution to create the prompt for the parameter and assign it to the variable declared in he sp.
Go to Top of Page
   

- Advertisement -