Results 1 to 1 of 1

Thread: DAO stored procedure SQL 7.0

Threaded View

  1. #1

    Thread Starter
    Lively Member
    Join Date
    Nov 1999
    Location
    Belgium
    Posts
    98

    DAO stored procedure SQL 7.0

    Who can make this work ???
    I have a sored procedure called "USERTEST_001 " and it inserts a value in a new record.
    when I execute I get an error : Cannot execute a select query.
    What am I doing wrong ???

    Thanks


    Code:
    Sub DoStoredProcedure()
    On Error GoTo sDebug
    
    Dim db_1 As DAO.Database
    Dim rs_2 As DAO.Recordset
    
    Dim Connect As String
    
    Dim sProc
    
    
    Connect = "ODBC;DSN=" & "HARDWARE" & ";UID=" & "test" & ";PWD=" & "test" & ";DATABASE=" & "CEMA_Hardware" & ";"
    Set db_1 = OpenDatabase("", False, False, Connect$)
        
    sProc = "USERTEST_001 'test'"
    
    'USERTEST_001 is as stored procedure (this is on the SQL server)
    
        '*******************************
        'CREATE PROCEDURE UserTest_001
            '@par1 char(10)
        'AS
        'insert into hardwaretest(BORNR)
        'values (@par1)
        '*******************************
    
    Call db_1.Execute(sProc)
    
    sDebug:
        Debug.Print Err.Description
        
        'Cannot execute a select query. --> this is my error
        
    End Sub
    Last edited by R@emdonck; Jul 30th, 2001 at 07:31 AM.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width