Executing MS SQL Server 2000 stored procs via MS Access 2000 
Author Message
 Executing MS SQL Server 2000 stored procs via MS Access 2000

To whom it may convern,
I am attempting to execute a MS SQL Server 2000 stored
proc from MS Access 2000.

I am getting an error (-2147217900) stating that I am
getting a 'syntax error or access violation'...
This error is being thrown on the ".Open cmdObject" line
at the bottom of the attached code snippet...

Any suggestions would be welcomed...
I'm not sure if I have my syntax correct to call a MS SQL
Server (that is running on locally on my
machine, 'mySQLServer') or if its some flakey coding

Here's the code that I have so far:
Dim cnnObject As ADODB.Connection
Dim cmdObject As ADODB.Command
Dim rstObject As ADODB.Recordset

'Create connection object
Set cnnObject = New ADODB.Connection

'Set up connection string
= "Provider=SQLOLEDB.1;Integrated Security=SSPI;Persist
Security Info=False;Initial Catalog=targetDb;Data

'Open the connection

'Create command object
Set cmdObject = New ADODB.Command

With cmdObject
   .ActiveConnection = cnnObject
   .CommandType = adCmdStoredProc
   .CommandText = "sp_copyTable 'parm1', 'parm2'"
   .CommandTimeout = 100
End With

'Create record set object
Set rstObject = New ADODB.Recordset

With rstObject
   .CursorLocation = adUseServer
   .CursorType = adOpenStatic
   .Open cmdObject            
End With

Sun, 11 Dec 2005 05:22:43 GMT  
 [ 1 post ] 

 Relevant Pages 

1. Calling a SQL Server 2000 store procedure from MS-Access

2. MS PJ 2000 and MS Word via VBA

3. progress bar error by modification (MS Project 2000, MS SQL 7.0 and IIS 5)

4. Driving MS Project from MS Access 2000 developed application

5. Command button won't make use of module driving MS Project from MS Access 2000

6. data environment - stored procedure - ms access 2000 db

7. MS Project and SQL Server 2000

8. MS SQL Server 2000 (Developer Engine)

9. adding a user DSN connection to MS SQL server 2000 using AD GPO logon scripts

10. SQL Server 2000 and MS XP

11. ms access 2000 and sql 7.0

12. How to make a LINK Table in SQL 2000 Like MS Access


Powered by phpBB® Forum Software