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)
 Syntax Error or Access Violation using SP

Author  Topic 

DanInManchester
Starting Member

2 Posts

Posted - 2002-09-23 : 10:53:47
I'm new to SQL server and this is probably a simple problem but I have the following SP....

Create Procedure StoredProcedure1

As
/* set nocount on */
return

complex eh ?
then i try so use it with VB ADO

Dim CMD As New ADODB.Command
With CMD
.CommandType = adCmdStoredProc
.CommandText = "Exec StoredProcedure1"
.ActiveConnection = cn
.Execute Options:=adExecuteNoRecords
End With

I always get the error "Syntax Error or Access Violation".
I can only assume its an access violation.
the SQL server is using windows authentication and im logged on as administrator (DBO)

my conn string is :
strConn = "Provider=sqloledb;Data Source=" & strServer & ";Initial Catalog=" & strDatabase & ";Integrated Security=SSPI"

any ideas or pointers as to what im doing wrong ?

thanks

Dan

KnooKie
Aged Yak Warrior

623 Posts

Posted - 2002-09-23 : 11:56:00
What is it you are trying to do with this Stored Procedure ?

It doesn't appear to do anything ?


===========
Paul
Go to Top of Page

JozzaTheWick
Starting Member

16 Posts

Posted - 2002-09-24 : 17:11:01
I tried your code. I think it's the 'exec' statement. Instead of:

CommandText = "Exec StoredProcedure1"

use

CommandText = "StoredProcedure1"

If your stored procedures use parameters you will need to pass them in via the Parameters collection.

Hope this helps.

J.
Go to Top of Page
   

- Advertisement -