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
 Development Tools
 ASP.NET
 VB shape command and stored procedures

Author  Topic 

ticatac
Starting Member

6 Posts

Posted - 2002-11-20 : 09:57:43
HI

I'm trying to use the shape command to call a MS SQL Server 2k stored procedure but all I keep getting is the error message 'Incorrect syntax near the keyword 'EXEC''.

This is the code I'm using:

.Command text = "SHAPE ({Call dbo.spStoredProcedure}) BY Registration"
.Execute

I get the error as soon as it hits the Execute command.

Any help greatly appreciated



Robwhittaker
Yak Posting Veteran

85 Posts

Posted - 2002-11-20 : 11:22:20
I don't really understand what you are trying to do here, but anyway if you read BOL the shape command uses Curly brackets and not normal ones so try

.Command text = "SHAPE {{Call dbo.spStoredProcedure}} BY Registration"
.Execute

I still think you'll get syntax error, just a different one. You should try out your sql in query analyser first and getting working there before putting it in to your VB. You would have found that the sql you posted was wrong in query analyser.

Rob

Go to Top of Page

ticatac
Starting Member

6 Posts

Posted - 2002-11-21 : 04:38:42
I realised about the curly bracketts not long after I posted but that wasn't the problem.

I hadn't used the correct connection string which was causing this error.



Go to Top of Page
   

- Advertisement -